Documentation ¶
Overview ¶
nolint:golint,stylecheck
Index ¶
- Constants
- func AbiInfoAddressToStorage(addr common.Address) string
- func BitbonBlockToDto(b []*Block, txFull bool) []*external.Block
- func BitbonTransactionToDto(t []*Transaction) []*external.TransactionResult
- func BitbonTransactionToHashesDto(t []*Transaction) []*external.TransactionResult
- func ContractVersionExists(contractVersion ContractVersion) bool
- func ContractVersionExistsString(contractVersion string) bool
- func EventTypeExists(eventType EventType) bool
- func EventTypeExistsString(eventType string) bool
- func GetMethod(methodName string) external.Method
- func OperationTypeStrings() []string
- func StorageToAbiInfoAddress(addr string) common.Address
- type AbiInfo
- type ApproveFullBalanceSafeTransferRequest
- type ApproveFullBalanceWPCSafeTransferRequest
- type ApproveSafeTransferRequest
- type ApproveTransferEvent
- type ApproveWPCSafeTransferRequest
- type AssetboxCryptoData
- type BatchSizeMessage
- type BitbonArgs
- type BitbonBalanceChanged
- type BitbonBalanceLocked
- type BitbonBalanceUnlocked
- type BitbonMonetizeArgs
- type BitbonTx
- type Block
- type BlockInfo
- type BlocksTimePeriodRequest
- type CancelApprovalArgs
- type CancelFullBalanceSafeTransferRequest
- type CancelFullBalanceWPCSafeTransferRequest
- type CancelSafeTransferRequest
- type CancelWPCSafeTransferRequest
- type ContractVersion
- type CreateFullBalanceSafeTransferRequest
- type CreateFullBalanceWPCSafeTransferRequest
- type CreateSafeTransferRequest
- type CreateWPCSafeTransferRequest
- type CustomEvent
- type DeleteAssetboxRequest
- type DirectTransferArgs
- type DirectTransferRequest
- type EmitBitbonRequest
- type EventType
- type ExpireSafeTransfersArgs
- type ExpireTransferResponse
- type FeeChargedEvent
- type FeeDistribution
- type FeeSettingsResponse
- type FrameTransferArgs
- type FullBalanceQuickTransferRequest
- type MonetizeRequest
- type Nonces
- type OperationType
- type ParseStatus
- type PrepareAssetboxesRequest
- type ProposeDistributionRequest
- type PublicAssetboxInfoResponse
- type QuickTransferArgs
- type QuickTransferCompleted
- type QuickTransferRequest
- type RangeBlocksByNumberRequest
- type SafeTransferArgs
- type SafeTransferCreated
- type ServiceFeeTransferArgs
- type ServiceFeeTransferParams
- type ServiceFeeTransferRequest
- type SetFeeDistributionParams
- type SetPublicAssetboxInfoRequest
- type Transaction
- type TransactionByBlockHashAndIndexRequest
- type TransactionByBlockNumberAndIndexRequest
- type TransactionTimePeriodRequest
- type TransferExpiredEvent
- type TransferResponse
Constants ¶
const ( DirectTransfer = "transferFrom" QuickTransfer = "quickTransfer" FullBalanceQuickTransfer = "quickTransferAll" CreateSafeTransfer = "createSafeTransfer" CreateFullBalanceSafeTransfer = "createSafeTransferAll" ApproveSafeTransfer = "approveSafeTransfer" ApproveFullBalanceSafeTransfer = "approveSafeTransferAll" CancelSafeTransfer = "cancelSafeTransfer" CancelFullBalanceSafeTransfer = "cancelSafeTransferAll" ExpireSafeTransfer = "expireSafeTransfers" CreateWPCSafeTransfer = "createWPCSafeTransfer" CreateFullBalanceWPCSafeTransfer = "createWPCSafeTransferAll" ApproveWPCSafeTransfer = "approveWPCSafeTransfer" ApproveFullBalanceWPCSafeTransfer = "approveWPCSafeTransferAll" CancelWPCSafeTransfer = "cancelWPCSafeTransfer" CancelFullBalanceWPCSafeTransfer = "cancelWPCSafeTransferAll" ServiceFeeTransfer = "feeTransfer" FrameTransfer = "frameTransfer" )
const ( // v1 DirectTransferV1MethodID = "23b872dd" CreateSafeTransferV1MethodID = "d172317b" ApproveSafeTransferV1MethodID = "d1408c8d" CancelSafeTransferV1MethodID = "8cac0630" MonetizeEmissionV1MethodID = "6b88cfc1" MonetizeCertificateV1MethodID = "0ceb4c53" // v2 DirectTransferV2MethodID = "ab67aa58" CreateSafeTransferV2MethodID = "6c9bcf6f" ApproveSafeTransferV2MethodID = "fd821f3f" CancelSafeTransferV2MethodID = "a8389ace" ExpireSafeTransferV2MethodID = "a5471f24" MonetizeEmissionV2MethodID = "6b88cfc1" MonetizeCertificateV2MethodID = "0ceb4c53" // v3 DirectTransferV3MethodID = "ab67aa58" QuickTransferV3MethodID = "536684e7" FullBalanceQuickTransferV3MethodId = "ff0833f9" FrameTransferV3MethodID = "2e7cfa0c" CreateSafeTransferV3MethodID = "6c9bcf6f" CreateFullBalanceSafeTransferV3MethodID = "e33fe72c" ApproveSafeTransferV3MethodID = "fd821f3f" ApproveFullBalanceSafeTransferV3MethodID = "47a17ecb" CancelSafeTransferV3MethodID = "a8389ace" CancelFullBalanceSafeTransferV3MethodID = "e48a66f7" ExpireSafeTransferV3MethodID = "a5471f24" CreateWPCSafeTransferV3MethodID = "9ca9dfa7" CreateFullBalanceWPCSafeTransferV3MethodId = "1a9b6d93" ApproveWPCSafeTransferV3MethodID = "c48bb729" ApproveFullBalanceWPCSafeTransferV3MethodID = "8313ea89" CancelWPCSafeTransferV3MethodID = "28b5f788" CancelFullBalanceWPCSafeTransferV3MethodID = "c8c2e567" ServiceFeeTransferV3MethodID = "4fe06442" )
Variables ¶
This section is empty.
Functions ¶
func AbiInfoAddressToStorage ¶
func BitbonBlockToDto ¶
BitbonBlockToDto converts clientBlock to dto.Block (proto). If txFull is true, dto.Block will contain dto.TransactionObject, else only list transaction hashes. If b is nil, return nil
func BitbonTransactionToDto ¶
func BitbonTransactionToDto(t []*Transaction) []*external.TransactionResult
BitbonTransactionToDto converts []clientTransaction to []*dto.TransactionResult (proto). Contains all fields dto.TransactionResult.Transaction
func BitbonTransactionToHashesDto ¶
func BitbonTransactionToHashesDto(t []*Transaction) []*external.TransactionResult
BitbonTransactionToHashesDto converts []clientTransaction to []*dto.TransactionResult (proto). Contains only txHashes
func ContractVersionExists ¶
func ContractVersionExists(contractVersion ContractVersion) bool
func EventTypeExists ¶
func EventTypeExistsString ¶
func OperationTypeStrings ¶
func OperationTypeStrings() []string
OperationTypeStrings returns a slice of all String values of the enum
func StorageToAbiInfoAddress ¶
Types ¶
type AbiInfo ¶
type AbiInfo struct { Address common.Address `json:"address"` AbiJSON string `json:"abiJson"` Version ContractVersion `json:"version"` ContractType contract_snapshot.ContractType `json:"contractType"` }
func AbiInfoFromStorage ¶
func (*AbiInfo) ToStorageAbiInfo ¶
type ApproveFullBalanceWPCSafeTransferRequest ¶
type ApproveFullBalanceWPCSafeTransferRequest struct { Address common.Address `json:"address"` TransferID string `json:"transferId"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type ApproveTransferEvent ¶
ApproveTransferEvent Duplicated code for reflection parse input in transactions
func (*ApproveTransferEvent) MarshalJSON ¶
func (arg *ApproveTransferEvent) MarshalJSON() ([]byte, error)
type ApproveWPCSafeTransferRequest ¶
type ApproveWPCSafeTransferRequest struct { Address common.Address `json:"address"` TransferID string `json:"transferId"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type AssetboxCryptoData ¶
type BatchSizeMessage ¶
type BitbonArgs ¶
type BitbonArgs interface {
ToExternalDTO() *external.BitbonArgs
}
type BitbonBalanceChanged ¶
type BitbonBalanceLocked ¶
type BitbonBalanceUnlocked ¶
type BitbonMonetizeArgs ¶
type BitbonMonetizeArgs struct { Assetbox common.Address `json:"assetbox"` Amount *big.Int `json:"amount"` }
For monetize txs
func (*BitbonMonetizeArgs) ToExternalDTO ¶
func (arg *BitbonMonetizeArgs) ToExternalDTO() *external.BitbonArgs
type BitbonTx ¶
type BitbonTx struct { Status bool `json:"status"` ParseStatus ParseStatus `json:"parseStatus"` ParseError error `json:"-"` TxError bitbonErrors.Error `json:"-"` Method string `json:"method"` Args BitbonArgs `json:"args"` Balances map[common.Address]*big.Int `json:"balances"` Sender common.Address `json:"sender"` Events []CustomEvent `json:"events"` }
func (*BitbonTx) MarshalJSON ¶
type Block ¶
type Block struct { Hash common.Hash Number *big.Int `json:"number"` ParentHash common.Hash `json:"parentHash"` Nonce uint64 `json:"nonce"` Miner common.Address `json:"miner"` MixHash common.Hash `json:"mixHash"` Difficulty *big.Int `json:"difficulty"` ExtraData string `json:"extraData"` Size string `json:"size"` GasLimit uint64 `json:"gasLimit"` GasUsed uint64 `json:"gasUsed"` Timestamp uint64 `json:"timestamp"` Transactions []*Transaction `json:"transactions"` }
func ToBitbonBlock ¶
func ToBitbonBlock(b *types.Block, txs []*Transaction) *Block
ToBitbonBlock converts types.Block (core ethereum) to Block. If b is nil, return empty struct
type BlocksTimePeriodRequest ¶
type CancelApprovalArgs ¶
type CancelApprovalArgs struct { Address common.Address `json:"address"` TransferId []byte `json:"transferId"` ExtraData []byte `json:"extraData"` }
CancelApprovalArgs For cancel and approve tx
func (*CancelApprovalArgs) MarshalJSON ¶
func (arg *CancelApprovalArgs) MarshalJSON() ([]byte, error)
func (*CancelApprovalArgs) ToExternalDTO ¶
func (arg *CancelApprovalArgs) ToExternalDTO() *external.BitbonArgs
type CancelFullBalanceSafeTransferRequest ¶
type CancelFullBalanceSafeTransferRequest struct { Address common.Address `json:"address"` TransferID string `json:"transferId"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type CancelFullBalanceWPCSafeTransferRequest ¶
type CancelFullBalanceWPCSafeTransferRequest struct { Address common.Address `json:"address"` TransferID string `json:"transferId"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type CancelSafeTransferRequest ¶
type CancelSafeTransferRequest struct { Address common.Address `json:"address"` TransferID string `json:"transferId"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type CancelWPCSafeTransferRequest ¶
type CancelWPCSafeTransferRequest struct { Address common.Address `json:"address"` TransferID string `json:"transferId"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type ContractVersion ¶
type ContractVersion string
const ( VersionV1 ContractVersion = "v1" VersionV2 ContractVersion = "v2" VersionV3 ContractVersion = "v3" )
type CreateFullBalanceSafeTransferRequest ¶
type CreateFullBalanceSafeTransferRequest struct { From common.Address `json:"from"` To common.Address `json:"to"` TransferID string `json:"transferId"` ProtectionCode string `json:"protectionCode"` BTSC string `json:"btsc"` Retries uint64 `json:"retries"` ExpiresAt int64 `json:"expiresAt"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
func (*CreateFullBalanceSafeTransferRequest) UnmarshalJSON ¶
func (r *CreateFullBalanceSafeTransferRequest) UnmarshalJSON(data []byte) error
type CreateFullBalanceWPCSafeTransferRequest ¶
type CreateFullBalanceWPCSafeTransferRequest struct { From common.Address `json:"from"` To common.Address `json:"to"` TransferID string `json:"transferId"` BTSC string `json:"btsc"` ExpiresAt int64 `json:"expiresAt"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
func (*CreateFullBalanceWPCSafeTransferRequest) UnmarshalJSON ¶
func (r *CreateFullBalanceWPCSafeTransferRequest) UnmarshalJSON(data []byte) error
type CreateSafeTransferRequest ¶
type CreateSafeTransferRequest struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` TransferID string `json:"transferId"` ProtectionCode string `json:"protectionCode"` Retries uint64 `json:"retries"` ExpiresAt int64 `json:"expiresAt"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
func (*CreateSafeTransferRequest) UnmarshalJSON ¶
func (r *CreateSafeTransferRequest) UnmarshalJSON(data []byte) error
type CreateWPCSafeTransferRequest ¶
type CreateWPCSafeTransferRequest struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` TransferID string `json:"transferId"` ExpiresAt int64 `json:"expiresAt"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
func (*CreateWPCSafeTransferRequest) UnmarshalJSON ¶
func (r *CreateWPCSafeTransferRequest) UnmarshalJSON(data []byte) error
type CustomEvent ¶
type DeleteAssetboxRequest ¶
type DeleteAssetboxRequest struct { Address common.Address `json:"address"` // assetbox address to delete CryptoData AssetboxCryptoData `json:"crypto_data"` }
type DirectTransferArgs ¶
type DirectTransferArgs struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` ExtraData []byte `json:"extraData"` }
For DirectTransfer
func (*DirectTransferArgs) ToExternalDTO ¶
func (arg *DirectTransferArgs) ToExternalDTO() *external.BitbonArgs
type DirectTransferRequest ¶
type DirectTransferRequest struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` ExtraData []byte `json:"extraData"` }
func (*DirectTransferRequest) UnmarshalJSON ¶
func (r *DirectTransferRequest) UnmarshalJSON(data []byte) error
type EmitBitbonRequest ¶
type EmitBitbonRequest struct { Address common.Address `json:"address"` Value *big.Int `json:"value"` }
func (*EmitBitbonRequest) UnmarshalJSON ¶
func (r *EmitBitbonRequest) UnmarshalJSON(data []byte) error
type EventType ¶
type EventType string
const ( BalanceChangedEventType EventType = "BalanceChanged" BalanceLockedEventType EventType = "BalanceLocked" BalanceUnLockedEventType EventType = "BalanceUnLocked" TransferExpiredEventType EventType = "TransferExpired" FeeChargedEventType EventType = "FeeCharged" QuickTransferCompletedEventType EventType = "QuickTransferCompleted" SafeTransferCreatedEventType EventType = "SafeTransferCreated" )
type ExpireSafeTransfersArgs ¶
type ExpireSafeTransfersArgs struct {
Ids [][32]byte `json:"ids"`
}
For Expire Safe Transfers
func (*ExpireSafeTransfersArgs) MarshalJSON ¶
func (arg *ExpireSafeTransfersArgs) MarshalJSON() ([]byte, error)
func (*ExpireSafeTransfersArgs) ToExternalDTO ¶
func (arg *ExpireSafeTransfersArgs) ToExternalDTO() *external.BitbonArgs
type ExpireTransferResponse ¶
type FeeChargedEvent ¶
type FeeChargedEvent struct { From common.Address `json:"from"` To common.Address `json:"to"` Fee *big.Int `json:"fee"` }
func (*FeeChargedEvent) GetType ¶
func (arg *FeeChargedEvent) GetType() EventType
func (*FeeChargedEvent) MarshalJSON ¶
func (arg *FeeChargedEvent) MarshalJSON() ([]byte, error)
func (*FeeChargedEvent) ToProto ¶
func (arg *FeeChargedEvent) ToProto() *external.Event
type FeeDistribution ¶
type FeeSettingsResponse ¶
type FeeSettingsResponse struct { ValueSettings map[int32]string DistributionSettings map[int32][]*FeeDistribution }
func (*FeeSettingsResponse) DistributionSettingsToExternalDTO ¶
func (o *FeeSettingsResponse) DistributionSettingsToExternalDTO() map[int32]*external.FeeDistributionSettings
type FrameTransferArgs ¶
type FrameTransferArgs struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` ExtraData []byte `json:"extraData"` }
For FrameTransfer
func (*FrameTransferArgs) ToExternalDTO ¶
func (arg *FrameTransferArgs) ToExternalDTO() *external.BitbonArgs
type MonetizeRequest ¶
type MonetizeRequest struct { Address common.Address `json:"address"` Value *big.Int `json:"value"` }
func (*MonetizeRequest) UnmarshalJSON ¶
func (r *MonetizeRequest) UnmarshalJSON(data []byte) error
type Nonces ¶
type Nonces struct { Redis interface{} // nonce in noncer redis Blockchain interface{} // nonce in blockchain TxPoolQueued interface{} // min nonce in tx pool queued transactions TxPoolPending interface{} // min nonce in tx pool pending transactions Broken bool // indicates if nonce is broken (there are transactions in tx pool queued transactions) }
type OperationType ¶
type OperationType int
const ( UndefinedOperationType OperationType = 0 QuickTransferOperationType OperationType = 101 QuickTransferAllOperationType OperationType = 102 CreateSafeTransferOperationType OperationType = 103 CreateSafeTransferAllOperationType OperationType = 104 CreateWpcSafeTransferOperationType OperationType = 105 CreateWpcSafeTransferAllOperationType OperationType = 106 CreateAssetboxOperationType OperationType = 201 )
func OperationTypeString ¶
func OperationTypeString(s string) (OperationType, error)
OperationTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func OperationTypeValues ¶
func OperationTypeValues() []OperationType
OperationTypeValues returns all values of the enum
func (OperationType) IsAOperationType ¶
func (i OperationType) IsAOperationType() bool
IsAOperationType returns "true" if the value is listed in the enum definition. "false" otherwise
func (OperationType) String ¶
func (i OperationType) String() string
type ParseStatus ¶
type ParseStatus uint8
const ( ParseStatusSuccess ParseStatus = 0 ParseStatusParseError ParseStatus = 1 ParseStatusParseInputError ParseStatus = 2 ParseStatusParseLogsError ParseStatus = 3 )
type PrepareAssetboxesRequest ¶
type PrepareAssetboxesRequest struct {
Count uint64 `json:"count"`
}
type ProposeDistributionRequest ¶
type ProposeDistributionRequest struct { Address common.Address `json:"address"` CryptoData AssetboxCryptoData `json:"crypto_data"` Distribution map[string]uint64 `json:"distribution"` }
type QuickTransferArgs ¶
type QuickTransferArgs struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` ExtraData []byte `json:"extraData"` }
For QuickTransfer
func (*QuickTransferArgs) ToExternalDTO ¶
func (arg *QuickTransferArgs) ToExternalDTO() *external.BitbonArgs
type QuickTransferCompleted ¶
type QuickTransferRequest ¶
type QuickTransferRequest struct { From common.Address `json:"from"` To common.Address `json:"to"` Value *big.Int `json:"value"` ExtraData []byte `json:"extraData"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
func (*QuickTransferRequest) UnmarshalJSON ¶
func (r *QuickTransferRequest) UnmarshalJSON(data []byte) error
type SafeTransferArgs ¶
type SafeTransferArgs struct { From common.Address `json:"from"` To common.Address `json:"to"` TransferId []byte `json:"transferId"` Value *big.Int `json:"value"` ExtraData []byte `json:"extraData"` }
For SafeTransfer
func (*SafeTransferArgs) MarshalJSON ¶
func (arg *SafeTransferArgs) MarshalJSON() ([]byte, error)
func (*SafeTransferArgs) ToExternalDTO ¶
func (arg *SafeTransferArgs) ToExternalDTO() *external.BitbonArgs
type SafeTransferCreated ¶
type ServiceFeeTransferArgs ¶
type ServiceFeeTransferArgs struct { OpType *big.Int `json:"opType"` From common.Address `json:"from"` }
func (*ServiceFeeTransferArgs) MarshalJSON ¶
func (arg *ServiceFeeTransferArgs) MarshalJSON() ([]byte, error)
func (*ServiceFeeTransferArgs) ToExternalDTO ¶
func (arg *ServiceFeeTransferArgs) ToExternalDTO() *external.BitbonArgs
type SetPublicAssetboxInfoRequest ¶
type SetPublicAssetboxInfoRequest struct { Address common.Address `json:"address"` Alias string `json:"alias"` IsPublic bool `json:"isPublic"` ExtraInfo string `json:"extraInfo"` IsMining bool `json:"isMining"` ServiceID string `json:"service_id"` CryptoData AssetboxCryptoData `json:"crypto_data"` }
type Transaction ¶
type Transaction struct { Hash common.Hash `json:"hash"` Nonce uint64 `json:"nonce"` BlockHash common.Hash `json:"blockHash"` BlockNumber uint64 `json:"blockNumber"` BlockTime uint64 `json:"blockTime"` GasPrice *big.Int `json:"gasPrice"` Gas uint64 `json:"gasLimit"` Time uint64 `json:"creates"` Size string `json:"size"` BitbonTx *BitbonTx `json:"bitbonTx"` }
func ToTransaction ¶
func ToTransaction(t *types.Transaction, bb *BitbonTx, bi *BlockInfo) *Transaction
type TransferExpiredEvent ¶
type TransferExpiredEvent struct {
TransferId []byte `json:"transferId"`
}
func (*TransferExpiredEvent) GetType ¶
func (arg *TransferExpiredEvent) GetType() EventType
func (*TransferExpiredEvent) MarshalJSON ¶
func (arg *TransferExpiredEvent) MarshalJSON() ([]byte, error)
func (*TransferExpiredEvent) ToProto ¶
func (arg *TransferExpiredEvent) ToProto() *external.Event