Documentation ¶
Index ¶
- Constants
- Variables
- type APIClient
- func (c *APIClient) Client() LiteClient
- func (c *APIClient) CurrentMasterchainInfo(ctx context.Context) (_ *BlockIDExt, err error)
- func (c *APIClient) GetAccount(ctx context.Context, block *BlockIDExt, addr *address.Address) (*tlb.Account, error)
- func (c *APIClient) GetBlockData(ctx context.Context, block *BlockIDExt) (*tlb.Block, error)
- func (c *APIClient) GetBlockShardsInfo(ctx context.Context, master *BlockIDExt) ([]*BlockIDExt, error)
- func (c *APIClient) GetBlockTransactions(ctx context.Context, block *BlockIDExt, count uint32, ...) ([]*tlb.TransactionID, bool, error)
- func (c *APIClient) GetBlockTransactionsV2(ctx context.Context, block *BlockIDExt, count uint32, after ...*TransactionID3) ([]TransactionShortInfo, bool, error)
- func (c *APIClient) GetBlockchainConfig(ctx context.Context, block *BlockIDExt, onlyParams ...int32) (*BlockchainConfig, error)
- func (c *APIClient) GetMasterchainInfo(ctx context.Context) (*BlockIDExt, error)
- func (c *APIClient) GetTime(ctx context.Context) (uint32, error)
- func (c *APIClient) GetTransaction(ctx context.Context, block *BlockIDExt, addr *address.Address, lt uint64) (*tlb.Transaction, error)
- func (c *APIClient) ListTransactions(ctx context.Context, addr *address.Address, limit uint32, lt uint64, ...) ([]*tlb.Transaction, error)
- func (c *APIClient) LookupBlock(ctx context.Context, workchain int32, shard int64, seqno uint32) (*BlockIDExt, error)
- func (c *APIClient) RunGetMethod(ctx context.Context, blockInfo *BlockIDExt, addr *address.Address, ...) (*ExecutionResult, error)
- func (c *APIClient) SendExternalMessage(ctx context.Context, msg *tlb.ExternalMessage) error
- func (c *APIClient) WaitForBlock(seqno uint32) APIClientWaiter
- func (c *APIClient) WaitNextMasterBlock(ctx context.Context, master *BlockIDExt) (*BlockIDExt, error)deprecated
- type APIClientWaiter
- type AccountID
- type AccountState
- type AllShardsInfo
- type BlockData
- type BlockHeader
- type BlockIDExt
- type BlockInfoShort
- type BlockTransactions
- type BlockchainConfig
- type ConfigAll
- type ContractExecError
- type CurrentTime
- type ExecutionResult
- func (r ExecutionResult) AsTuple() []any
- func (r ExecutionResult) Builder(index uint) (*cell.Builder, error)
- func (r ExecutionResult) Cell(index uint) (*cell.Cell, error)
- func (r ExecutionResult) Int(index uint) (*big.Int, error)
- func (r ExecutionResult) IsNil(index uint) (bool, error)
- func (r ExecutionResult) MustBuilder(index uint) *cell.Builder
- func (r ExecutionResult) MustCell(index uint) *cell.Cell
- func (r ExecutionResult) MustInt(index uint) *big.Int
- func (r ExecutionResult) MustIsNil(index uint) bool
- func (r ExecutionResult) MustSlice(index uint) *cell.Slice
- func (r ExecutionResult) MustTuple(index uint) []any
- func (r ExecutionResult) Slice(index uint) (*cell.Slice, error)
- func (r ExecutionResult) Tuple(index uint) ([]any, error)
- type GetAccountState
- type GetAllShardsInfo
- type GetBlockData
- type GetConfigAll
- type GetConfigParams
- type GetMasterchainInf
- type GetOneTransaction
- type GetTime
- type GetTransactions
- type LSError
- type ListBlockTransactions
- type LiteClient
- type LookupBlock
- type MasterchainInfo
- type Object
- type RunMethodResult
- type RunSmcMethod
- type SendMessage
- type SendMessageStatus
- type TransactionID
- type TransactionID3
- type TransactionInfo
- type TransactionList
- type TransactionShortInfo
- type True
- type WaitMasterchainSeqno
- type ZeroStateIDExt
Constants ¶
const (
ErrCodeContractNotInitialized = -256
)
Variables ¶
var ErrBlockNotFound = errors.New("block not found")
var ErrIncorrectResultType = errors.New("incorrect result type")
var ErrMessageNotAccepted = errors.New("message was not accepted by the contract")
var ErrNoNewBlocks = errors.New("no new blocks in a given timeout or in 10 seconds")
var ErrResultIndexOutOfRange = errors.New("result index is out of range")
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
func NewAPIClient ¶
func NewAPIClient(client LiteClient) *APIClient
func (*APIClient) Client ¶ added in v1.3.0
func (c *APIClient) Client() LiteClient
func (*APIClient) CurrentMasterchainInfo ¶ added in v1.1.0
func (c *APIClient) CurrentMasterchainInfo(ctx context.Context) (_ *BlockIDExt, err error)
CurrentMasterchainInfo - cached version of GetMasterchainInfo to not do it in parallel many times
func (*APIClient) GetAccount ¶ added in v0.3.0
func (*APIClient) GetBlockData ¶ added in v0.8.0
GetBlockData - get block detailed information
func (*APIClient) GetBlockShardsInfo ¶ added in v0.9.0
func (c *APIClient) GetBlockShardsInfo(ctx context.Context, master *BlockIDExt) ([]*BlockIDExt, error)
GetBlockShardsInfo - gets the information about workchains and its shards at given masterchain state
func (*APIClient) GetBlockTransactions ¶ added in v0.8.0
func (c *APIClient) GetBlockTransactions(ctx context.Context, block *BlockIDExt, count uint32, after ...*tlb.TransactionID) ([]*tlb.TransactionID, bool, error)
GetBlockTransactions - list of block transactions Deprecated: Will be removed in the next release, use GetBlockTransactionsV2
func (*APIClient) GetBlockTransactionsV2 ¶ added in v1.6.0
func (c *APIClient) GetBlockTransactionsV2(ctx context.Context, block *BlockIDExt, count uint32, after ...*TransactionID3) ([]TransactionShortInfo, bool, error)
GetBlockTransactionsV2 - list of block transactions
func (*APIClient) GetBlockchainConfig ¶ added in v1.4.0
func (c *APIClient) GetBlockchainConfig(ctx context.Context, block *BlockIDExt, onlyParams ...int32) (*BlockchainConfig, error)
func (*APIClient) GetMasterchainInfo ¶ added in v0.9.0
func (c *APIClient) GetMasterchainInfo(ctx context.Context) (*BlockIDExt, error)
GetMasterchainInfo - gets the latest state of master chain
func (*APIClient) GetTransaction ¶ added in v0.9.0
func (c *APIClient) GetTransaction(ctx context.Context, block *BlockIDExt, addr *address.Address, lt uint64) (*tlb.Transaction, error)
func (*APIClient) ListTransactions ¶ added in v0.5.0
func (c *APIClient) ListTransactions(ctx context.Context, addr *address.Address, limit uint32, lt uint64, txHash []byte) ([]*tlb.Transaction, error)
ListTransactions - returns list of transactions before (including) passed lt and hash, the oldest one is first in result slice
func (*APIClient) LookupBlock ¶ added in v0.9.0
func (c *APIClient) LookupBlock(ctx context.Context, workchain int32, shard int64, seqno uint32) (*BlockIDExt, error)
LookupBlock - find block information by seqno, shard and chain
func (*APIClient) RunGetMethod ¶
func (c *APIClient) RunGetMethod(ctx context.Context, blockInfo *BlockIDExt, addr *address.Address, method string, params ...any) (*ExecutionResult, error)
func (*APIClient) SendExternalMessage ¶ added in v0.4.0
func (*APIClient) WaitForBlock ¶ added in v1.7.0
func (c *APIClient) WaitForBlock(seqno uint32) APIClientWaiter
func (*APIClient) WaitNextMasterBlock
deprecated
added in
v1.3.0
func (c *APIClient) WaitNextMasterBlock(ctx context.Context, master *BlockIDExt) (*BlockIDExt, error)
Deprecated: use APIClient.WaitForBlock as method prefix
type APIClientWaiter ¶ added in v1.7.0
type APIClientWaiter interface { GetTime(ctx context.Context) (uint32, error) LookupBlock(ctx context.Context, workchain int32, shard int64, seqno uint32) (*BlockIDExt, error) GetBlockData(ctx context.Context, block *BlockIDExt) (*tlb.Block, error) GetBlockTransactionsV2(ctx context.Context, block *BlockIDExt, count uint32, after ...*TransactionID3) ([]TransactionShortInfo, bool, error) GetBlockShardsInfo(ctx context.Context, master *BlockIDExt) ([]*BlockIDExt, error) GetBlockchainConfig(ctx context.Context, block *BlockIDExt, onlyParams ...int32) (*BlockchainConfig, error) GetMasterchainInfo(ctx context.Context) (*BlockIDExt, error) GetAccount(ctx context.Context, block *BlockIDExt, addr *address.Address) (*tlb.Account, error) SendExternalMessage(ctx context.Context, msg *tlb.ExternalMessage) error RunGetMethod(ctx context.Context, blockInfo *BlockIDExt, addr *address.Address, method string, params ...interface{}) (*ExecutionResult, error) ListTransactions(ctx context.Context, addr *address.Address, num uint32, lt uint64, txHash []byte) ([]*tlb.Transaction, error) GetTransaction(ctx context.Context, block *BlockIDExt, addr *address.Address, lt uint64) (*tlb.Transaction, error) }
type AccountState ¶ added in v1.6.0
type AccountState struct { ID *BlockIDExt `tl:"struct"` Shard *BlockIDExt `tl:"struct"` ShardProof []byte `tl:"bytes"` Proof []byte `tl:"bytes"` State []byte `tl:"bytes"` }
type AllShardsInfo ¶ added in v1.6.0
type AllShardsInfo struct { ID *BlockIDExt `tl:"struct"` Proof []byte `tl:"bytes"` Data []byte `tl:"bytes"` }
type BlockData ¶ added in v1.6.0
type BlockData struct { ID *BlockIDExt `tl:"struct"` Payload []byte `tl:"bytes"` }
type BlockHeader ¶ added in v1.6.0
type BlockHeader struct { ID *BlockIDExt `tl:"struct"` Mode uint32 `tl:"flags"` HeaderProof []byte `tl:"bytes"` }
type BlockIDExt ¶ added in v1.6.0
TODO: will be moved here in the next version
type BlockInfoShort ¶ added in v1.6.0
type BlockTransactions ¶ added in v1.6.0
type BlockTransactions struct { ID *BlockIDExt `tl:"struct"` ReqCount int32 `tl:"int"` Incomplete bool `tl:"bool"` TransactionIds []TransactionID `tl:"vector struct"` Proof []byte `tl:"bytes"` }
type BlockchainConfig ¶ added in v1.4.0
type BlockchainConfig struct {
// contains filtered or unexported fields
}
type ConfigAll ¶ added in v1.6.0
type ConfigAll struct { Mode int `tl:"int"` ID *BlockIDExt `tl:"struct"` StateProof []byte `tl:"bytes"` ConfigProof []byte `tl:"bytes"` }
type ContractExecError ¶ added in v0.7.2
type ContractExecError struct {
Code int32
}
func (ContractExecError) Error ¶ added in v0.7.2
func (e ContractExecError) Error() string
func (ContractExecError) Is ¶ added in v0.7.2
func (e ContractExecError) Is(err error) bool
type CurrentTime ¶ added in v1.6.0
type CurrentTime struct {
Now uint32 `tl:"int"`
}
type ExecutionResult ¶ added in v1.3.0
type ExecutionResult struct {
// contains filtered or unexported fields
}
func NewExecutionResult ¶ added in v1.3.0
func NewExecutionResult(data []any) *ExecutionResult
func (ExecutionResult) AsTuple ¶ added in v1.3.0
func (r ExecutionResult) AsTuple() []any
func (ExecutionResult) Builder ¶ added in v1.3.0
func (r ExecutionResult) Builder(index uint) (*cell.Builder, error)
func (ExecutionResult) Cell ¶ added in v1.3.0
func (r ExecutionResult) Cell(index uint) (*cell.Cell, error)
func (ExecutionResult) Int ¶ added in v1.3.0
func (r ExecutionResult) Int(index uint) (*big.Int, error)
func (ExecutionResult) IsNil ¶ added in v1.3.0
func (r ExecutionResult) IsNil(index uint) (bool, error)
func (ExecutionResult) MustBuilder ¶ added in v1.3.0
func (r ExecutionResult) MustBuilder(index uint) *cell.Builder
func (ExecutionResult) MustCell ¶ added in v1.3.0
func (r ExecutionResult) MustCell(index uint) *cell.Cell
func (ExecutionResult) MustInt ¶ added in v1.3.0
func (r ExecutionResult) MustInt(index uint) *big.Int
func (ExecutionResult) MustIsNil ¶ added in v1.3.0
func (r ExecutionResult) MustIsNil(index uint) bool
func (ExecutionResult) MustSlice ¶ added in v1.3.0
func (r ExecutionResult) MustSlice(index uint) *cell.Slice
func (ExecutionResult) MustTuple ¶ added in v1.3.0
func (r ExecutionResult) MustTuple(index uint) []any
type GetAccountState ¶ added in v1.6.0
type GetAccountState struct { ID *BlockIDExt `tl:"struct"` Account AccountID `tl:"struct"` }
type GetAllShardsInfo ¶ added in v1.6.0
type GetAllShardsInfo struct {
ID *BlockIDExt `tl:"struct"`
}
type GetBlockData ¶ added in v1.6.0
type GetBlockData struct {
ID *BlockIDExt `tl:"struct"`
}
type GetConfigAll ¶ added in v1.6.0
type GetConfigAll struct { Mode int32 `tl:"int"` BlockID *BlockIDExt `tl:"struct"` }
type GetConfigParams ¶ added in v1.6.0
type GetConfigParams struct { Mode int32 `tl:"int"` BlockID *BlockIDExt `tl:"struct"` Params []int32 `tl:"vector int"` }
type GetMasterchainInf ¶ added in v1.6.0
type GetMasterchainInf struct{}
type GetOneTransaction ¶ added in v1.6.0
type GetOneTransaction struct { ID *BlockIDExt `tl:"struct"` AccID *AccountID `tl:"struct"` LT int64 `tl:"long"` }
type GetTransactions ¶ added in v1.6.0
type ListBlockTransactions ¶ added in v1.6.0
type ListBlockTransactions struct { ID *BlockIDExt `tl:"struct"` Mode uint32 `tl:"flags"` Count uint32 `tl:"int"` After *TransactionID3 `tl:"?7 struct"` ReverseOrder *True `tl:"?6 struct boxed"` WantProof *True `tl:"?5 struct boxed"` }
type LiteClient ¶
type LookupBlock ¶ added in v1.6.0
type LookupBlock struct { Mode uint32 `tl:"flags"` ID *BlockInfoShort `tl:"struct"` LT uint64 `tl:"?1 long"` UTime uint32 `tl:"?2 int"` }
type MasterchainInfo ¶ added in v1.6.0
type MasterchainInfo struct { Last *BlockIDExt `tl:"struct"` StateRootHash []byte `tl:"int256"` Init *ZeroStateIDExt `tl:"struct"` }
type RunMethodResult ¶ added in v1.6.0
type RunMethodResult struct { Mode uint32 `tl:"flags"` ID *BlockIDExt `tl:"struct"` ShardBlock *BlockIDExt `tl:"struct"` ShardProof []byte `tl:"?0 bytes"` Proof []byte `tl:"?0 bytes"` StateProof []byte `tl:"?1 bytes"` InitC7 []byte `tl:"?3 bytes"` LibExtras []byte `tl:"?4 bytes"` ExitCode int32 `tl:"int"` Result []byte `tl:"?2 bytes"` }
type RunSmcMethod ¶ added in v1.6.0
type RunSmcMethod struct { Mode uint32 `tl:"int"` ID *BlockIDExt `tl:"struct"` Account AccountID `tl:"struct"` MethodID uint64 `tl:"long"` Params []byte `tl:"bytes"` }
type SendMessage ¶ added in v1.6.0
type SendMessage struct {
Body []byte `tl:"bytes"`
}
type SendMessageStatus ¶ added in v1.6.0
type SendMessageStatus struct {
Status int32 `tl:"int"`
}
type TransactionID ¶ added in v1.6.0
type TransactionID3 ¶ added in v1.6.0
type TransactionInfo ¶ added in v1.6.0
type TransactionInfo struct { ID *BlockIDExt `tl:"struct"` Proof []byte `tl:"bytes"` Transaction []byte `tl:"bytes"` }
type TransactionList ¶ added in v1.6.0
type TransactionList struct { IDs []*BlockIDExt `tl:"vector struct"` Transactions []byte `tl:"bytes"` }
type TransactionShortInfo ¶ added in v1.6.0
func (*TransactionShortInfo) ID3 ¶ added in v1.6.0
func (t *TransactionShortInfo) ID3() *TransactionID3