Documentation
¶
Overview ¶
Package v1 provides CREC SDK extension for DTA (Digital Transfer Agent) v1.0.
This package is organized into sub-packages:
- v1/events: Lightweight event types, decoders, and constants.
- v1/contracts: Embedded ABI JSON and parsed ABI accessors.
- v1/operations: Extension client for preparing on-chain operations.
The root v1 package provides DecodeFromEvent for SDK consumers to decode watcher event payloads into typed Go structs.
Decoding Events ¶
decoded, err := v1.DecodeFromEvent(ctx, event)
if err != nil {
log.Fatal(err)
}
fmt.Println(decoded.EventName())
Preparing Operations ¶
import "github.com/smartcontractkit/crec-sdk-ext-dta/v1/operations"
ext, err := operations.New(&operations.Options{
DTARequestManagementAddress: "0x...",
DTARequestSettlementAddress: "0x...",
AccountAddress: "0x...",
})
op, err := ext.PrepareRequestSubscriptionOperation(fundAdmin, fundTokenId, amount)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DecodedEvent ¶
type DecodedEvent struct {
apiClient.WatcherEventPayload
// ConcreteEvent is the decoded event struct matching the blockchain event type.
ConcreteEvent events.ConcreteEvent
// FundTokenData holds fund token configuration from on-chain reference data, when present.
FundTokenData *events.FundTokenData
// DistributorRequest holds the distributor request from on-chain reference data, when present.
DistributorRequest *events.DistributorRequest
// PaymentRequests holds payment requests from the verifiable event reference data.
PaymentRequests []workflows.PaymentRequest
}
DecodedEvent wraps WatcherEventPayload with a decoded ConcreteEvent and enrichment data.
func DecodeFromEvent ¶
DecodeFromEvent extracts the WatcherEventPayload from an apiClient.Event and decodes the ConcreteEvent and enrichment data (FundTokenData, DistributorRequest, PaymentRequests) based on the event type.
func (DecodedEvent) EventName ¶
func (e DecodedEvent) EventName() events.EventName
EventName returns the parsed event name from the payload.
Click to show internal directories.
Click to hide internal directories.