Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeCallResult[T any](result *client.CallResult) ([]T, error)
- func GetContractContent(input DeployStreamInput) ([]byte, error)
- type ComposedStream
- type DeployStreamInput
- type DeployStreamOutput
- type DescribeTaxonomiesResult
- type DestroyStreamInput
- type DestroyStreamOutput
- type GetIndexRawOutput
- type GetRecordRawOutput
- type NewStreamOptions
- type PrimitiveStream
- type Stream
- func (s *Stream) AllowComposeStream(ctx context.Context, locator types.StreamLocator) (transactions.TxHash, error)
- func (s *Stream) AllowReadWallet(ctx context.Context, wallet util.EthereumAddress) (transactions.TxHash, error)
- func (s *Stream) DisableComposeStream(ctx context.Context, locator types.StreamLocator) (transactions.TxHash, error)
- func (s *Stream) DisableReadWallet(ctx context.Context, wallet util.EthereumAddress) (transactions.TxHash, error)
- func (s *Stream) GetAllowedComposeStreams(ctx context.Context) ([]types.StreamLocator, error)
- func (s *Stream) GetAllowedReadWallets(ctx context.Context) ([]util.EthereumAddress, error)
- func (s *Stream) GetComposeVisibility(ctx context.Context) (*util.VisibilityEnum, error)
- func (s *Stream) GetIndex(ctx context.Context, input types.GetIndexInput) ([]types.StreamIndex, error)
- func (s *Stream) GetReadVisibility(ctx context.Context) (*util.VisibilityEnum, error)
- func (s *Stream) GetRecord(ctx context.Context, input types.GetRecordInput) ([]types.StreamRecord, error)
- func (s *Stream) GetSchema(ctx context.Context) (*types.Schema, error)
- func (s *Stream) GetStreamOwner(ctx context.Context) ([]byte, error)
- func (s *Stream) GetType(ctx context.Context) (tsntypes.StreamType, error)
- func (s *Stream) InitializeStream(ctx context.Context) (transactions.TxHash, error)
- func (s *Stream) SetComposeVisibility(ctx context.Context, visibility util.VisibilityEnum) (transactions.TxHash, error)
- func (s *Stream) SetReadVisibility(ctx context.Context, visibility util.VisibilityEnum) (transactions.TxHash, error)
- func (s *Stream) ToComposedStream() (*ComposedStream, error)
- func (s *Stream) ToPrimitiveStream() (*PrimitiveStream, error)
Constants ¶
View Source
const (
ErrorStreamNotComposed = "stream is not a composed stream"
)
View Source
const (
ErrorStreamNotFound = "stream not found"
)
View Source
const (
ErrorStreamNotPrimitive = "stream is not a primitive stream"
)
Variables ¶
View Source
var MetadataValueNotFound = errors.New("metadata value not found")
Functions ¶
func DecodeCallResult ¶
func DecodeCallResult[T any](result *client.CallResult) ([]T, error)
DecodeCallResult decodes the result of a view call to the specified struct.
func GetContractContent ¶
func GetContractContent(input DeployStreamInput) ([]byte, error)
GetContractContent returns the contract content based on the stream type
Types ¶
type ComposedStream ¶
type ComposedStream struct {
Stream
}
func ComposedStreamFromStream ¶
func ComposedStreamFromStream(stream Stream) (*ComposedStream, error)
func NewComposedStream ¶
func NewComposedStream(opts NewStreamOptions) (*ComposedStream, error)
func (*ComposedStream) DescribeTaxonomies ¶
func (c *ComposedStream) DescribeTaxonomies(ctx context.Context, params types.DescribeTaxonomiesParams) ([]types.TaxonomyItem, error)
func (*ComposedStream) SetTaxonomy ¶
func (c *ComposedStream) SetTaxonomy(ctx context.Context, taxonomies []types.TaxonomyItem) (transactions.TxHash, error)
type DeployStreamInput ¶
type DeployStreamOutput ¶
type DeployStreamOutput struct { DeployedStream Stream TxHash transactions.TxHash }
func DeployStream ¶
func DeployStream(ctx context.Context, input DeployStreamInput) (*DeployStreamOutput, error)
DeployStream deploys a stream to TSN
type DescribeTaxonomiesResult ¶
type DescribeTaxonomiesResult struct { ChildStreamId util.StreamId `json:"child_stream_id"` ChildDataProvider string `json:"child_data_provider"` // decimals are received as strings by kwil to avoid precision loss // as decimal are more arbitrary than golang's float64 Weight string `json:"weight"` CreatedAt int `json:"created_at"` Version int `json:"version"` }
type DestroyStreamInput ¶
type DestroyStreamInput struct { StreamId util.StreamId `validate:"required"` KwilClient client.Client `validate:"required"` }
func (DestroyStreamInput) Validate ¶
func (i DestroyStreamInput) Validate() error
type DestroyStreamOutput ¶
type DestroyStreamOutput struct {
TxHash transactions.TxHash
}
func DestroyStream ¶
func DestroyStream(ctx context.Context, input DestroyStreamInput) (*DestroyStreamOutput, error)
DestroyStream destroys a stream from TSN
type GetIndexRawOutput ¶
type GetIndexRawOutput = GetRecordRawOutput
type GetRecordRawOutput ¶
type NewStreamOptions ¶
type PrimitiveStream ¶
type PrimitiveStream struct {
Stream
}
func NewPrimitiveStream ¶
func NewPrimitiveStream(options NewStreamOptions) (*PrimitiveStream, error)
func PrimitiveStreamFromStream ¶
func PrimitiveStreamFromStream(stream Stream) (*PrimitiveStream, error)
func (*PrimitiveStream) InsertRecords ¶
func (p *PrimitiveStream) InsertRecords(ctx context.Context, inputs []types.InsertRecordInput) (transactions.TxHash, error)
type Stream ¶
func NewStream ¶
func NewStream(options NewStreamOptions) (*Stream, error)
func (*Stream) AllowComposeStream ¶
func (s *Stream) AllowComposeStream(ctx context.Context, locator types.StreamLocator) (transactions.TxHash, error)
func (*Stream) AllowReadWallet ¶
func (s *Stream) AllowReadWallet(ctx context.Context, wallet util.EthereumAddress) (transactions.TxHash, error)
func (*Stream) DisableComposeStream ¶
func (s *Stream) DisableComposeStream(ctx context.Context, locator types.StreamLocator) (transactions.TxHash, error)
func (*Stream) DisableReadWallet ¶
func (s *Stream) DisableReadWallet(ctx context.Context, wallet util.EthereumAddress) (transactions.TxHash, error)
func (*Stream) GetAllowedComposeStreams ¶
func (*Stream) GetAllowedReadWallets ¶
func (*Stream) GetComposeVisibility ¶
func (*Stream) GetIndex ¶
func (s *Stream) GetIndex(ctx context.Context, input types.GetIndexInput) ([]types.StreamIndex, error)
func (*Stream) GetReadVisibility ¶
func (*Stream) GetRecord ¶
func (s *Stream) GetRecord(ctx context.Context, input types.GetRecordInput) ([]types.StreamRecord, error)
func (*Stream) GetStreamOwner ¶
func (*Stream) InitializeStream ¶
func (*Stream) SetComposeVisibility ¶
func (s *Stream) SetComposeVisibility(ctx context.Context, visibility util.VisibilityEnum) (transactions.TxHash, error)
func (*Stream) SetReadVisibility ¶
func (s *Stream) SetReadVisibility(ctx context.Context, visibility util.VisibilityEnum) (transactions.TxHash, error)
func (*Stream) ToComposedStream ¶
func (s *Stream) ToComposedStream() (*ComposedStream, error)
func (*Stream) ToPrimitiveStream ¶
func (s *Stream) ToPrimitiveStream() (*PrimitiveStream, error)
Click to show internal directories.
Click to hide internal directories.