bindings

package
v0.0.0-...-346157b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEntityName

func GetEntityName(templateID string) string

GetEntityName extracts the entity name from a template ID. Template IDs are in the format "#packageID:moduleName:entityName" or "moduleName:entityName".

func MarshalTemplateToRecord

func MarshalTemplateToRecord(v model.CreateCommander) *apiv2.Record

func UnmarshalActiveContract

func UnmarshalActiveContract[T any](ac *apiv2.GetActiveContractsResponse_ActiveContract) (*T, error)

UnmarshalActiveContract unmarshalls a Canton ActiveContract response into a typed DAML binding struct. This provides type-safe access to contract fields instead of manual string-based field parsing.

Example usage:

mcmsContract, err := UnmarshalActiveContract[mcms.MCMS](activeContract)
if err != nil {
    return err
}
// Now use type-safe fields: mcmsContract.McmsId, mcmsContract.Config.Signers, etc.

func UnmarshalCreatedEvent

func UnmarshalCreatedEvent[T any](event *apiv2.CreatedEvent) (*T, error)

UnmarshalCreatedEvent unmarshalls a CreatedEvent into a typed DAML binding struct. This is useful when you have a CreatedEvent directly (e.g., from transaction events).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL