factory

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationBurnMintFactory = "burn_mint_factory"
	OperationTransferFactory = "transfer_factory"
	OperationBridgeHoldings  = "bridge_holdings"
)

Fixed operation names for the DA request metrics. They deliberately identify the route, not the URL: the URLs carry party IDs and query parameters.

View Source
const RegistrarScopePrefix = "/api/token-standard/v0/registrars/"

RegistrarScopePrefix scopes DA's token-standard transfer API to one registrar (the instrument admin): <host>/api/token-standard/v0/registrars/<admin>/…

Variables

This section is empty.

Functions

func RegistrarScopedURL added in v1.3.0

func RegistrarScopedURL(host string, admin types.PARTY) string

RegistrarScopedURL scopes the host-only discovery URL to the pool's instrument admin. Values already carrying a path (static per-pool configs) pass through.

Types

type AddressBurnMintFactory

type AddressBurnMintFactory struct {
	// contains filtered or unexported fields
}

AddressBurnMintFactory is a DisclosureFactory implementation that looks up a BurnMintFactory from an InstanceAddress directly.

type AddressTransferFactory

type AddressTransferFactory struct {
	// contains filtered or unexported fields
}

func (AddressTransferFactory) GetFeeTokenDisclosures added in v1.1.0

type BridgeHoldingsDisclosureFactory added in v1.3.0

type BridgeHoldingsDisclosureFactory interface {
	GetBridgeHoldings(
		ctx context.Context,
		owner types.PARTY,
		instrumentId splice_api_token_holding_v1.InstrumentId,
	) ([]oapiCommon.DisclosedContract, error)
}

BridgeHoldingsDisclosureFactory resolves a pool owner's holdings via DA's explicit-disclosure bridge API, when the local holdings store cannot see them.

type DisclosureFactory

type DisclosureFactory interface {
	// GetSendDisclosures fetches the transfer factory and its choice context for a
	// pool's lock transfer. poolReceiveMeta carries the pool's poolReceiveMetadata so
	// the token-standard backend returns the right context mode: transfers with a
	// named receiver label (e.g. cip-112/receiver.id) get the two-step context,
	// "" only the direct/preapproved one.
	GetSendDisclosures(ctx context.Context, message oapiCommon.Message, poolReceiveMeta map[string]types.TEXT) (types.CONTRACT_ID, splice_api_token_metadata_v1.ChoiceContext, []oapiCommon.DisclosedContract, error)
	GetExecuteDisclosures(
		ctx context.Context,
		message *protocol.Message,
		instrumentId splice_api_token_holding_v1.InstrumentId,
		inputHoldingCids []types.CONTRACT_ID,
		receiver types.PARTY,
	) (types.CONTRACT_ID, splice_api_token_metadata_v1.ChoiceContext, []oapiCommon.DisclosedContract, error)
}

func NewBurnMintFactory

func NewBurnMintFactory(ctx context.Context, poolOwner types.PARTY, acs store.ActiveContractStoreInterface, cfg config.Factory, opts ...Option) (DisclosureFactory, error)

type FeeTokenDisclosureFactory added in v1.1.0

type FeeTokenDisclosureFactory interface {
	GetFeeTokenDisclosures(
		ctx context.Context,
		instrumentId splice_api_token_holding_v1.InstrumentId,
		sender types.PARTY,
		receiver types.PARTY,
	) (types.CONTRACT_ID, splice_api_token_metadata_v1.ChoiceContext, []oapiCommon.DisclosedContract, error)
}

FeeTokenDisclosureFactory fetches the transfer factory disclosures for a fee token, used by the CCIP API to return the fee token's transfer factory disclosures to clients.

type Metrics added in v1.3.0

type Metrics interface {
	RecordDARequest(ctx context.Context, operation string, success bool, duration time.Duration)
}

Metrics records the outcome of outgoing requests to DA endpoints. It is implemented by the global common.EDSMetricLabeler.

type Option added in v1.3.0

type Option func(*options)

Option configures the factories created by NewBurnMintFactory and NewTransferFactory.

func WithMetrics added in v1.3.0

func WithMetrics(metrics Metrics) Option

WithMetrics makes the factories record their DA requests. Without it nothing is recorded.

type RequestBurnMintFactory

type RequestBurnMintFactory struct {
	// contains filtered or unexported fields
}

RequestBurnMintFactory is a DisclosureFactory implementation that requests a BurnMintFactory from another URL. It calls DA's Registry to retrieve both the factory and ChoiceContext. Contrary to URLBurnMintFactory, it uses separate endpoints for send/execute: - getMintRequestCreateContext for execution - getBurnRequestCreateContext for sending

type TransferDisclosureFactory added in v1.1.0

type TransferDisclosureFactory interface {
	DisclosureFactory
	FeeTokenDisclosureFactory
}

TransferDisclosureFactory is a DisclosureFactory backed by a token-standard TransferFactory, which can additionally resolve fee token disclosures.

type URLBurnMintFactory

type URLBurnMintFactory struct {
	// contains filtered or unexported fields
}

URLBurnMintFactory is a DisclosureFactory implementation that requests a BurnMintFactory from another URL. It calls DA's Registry to retrieve both the factory and ChoiceContext using the getBurnMintFactory endpoint for both send & execute directions.

type URLTransferFactory

type URLTransferFactory struct {
	// contains filtered or unexported fields
}

func (URLTransferFactory) GetBridgeHoldings added in v1.3.0

GetBridgeHoldings fetches the owner's publicly disclosed holdings from DA's bridge API, when the local holdings store cannot see them. instrumentId is the bare id ("TESTLINK6LR"), not the "id@admin" form.

func (URLTransferFactory) GetFeeTokenDisclosures added in v1.1.0

Jump to

Keyboard shortcuts

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