Splice.AmuletRules

Templates

template AmuletRules

The rules governing how Amulet users can modify the Amulet state managed by the DSO party.

Signatory: dso

Field

Type

Description

dso

Party

configSchedule

Schedule Time (AmuletConfig USD)

isDevNet

Bool

template ExternalPartySetupProposal

Signatory: validator, dso

Field

Type

Description

validator

Party

user

Party

dso

Party

createdAt

Time

preapprovalExpiresAt

Time

template TransferPreapproval

A pre-approval by a receiver to receive Amulet from anybody.

Pre-approvals are indexed by the SVs and served from scan for easy discovery until they expire. The cost of providing this discovery service is charged by burning Amulet.

Receivers can either purchase and renew these pre-approvals by themselves, or have an app provider do so for them in exchange for the app rewards for the amulet transfers completed via the managed pre-approval.

Signatory: receiver, provider, dso

Field

Type

Description

dso

Party

receiver

Party

The receiver party

provider

Party

The app provider that manages the pre-approval for the receiver. Equal to the receiver for self-managed pre-approvals.

validFrom

Time

This timestamp marks the start of the period for which fees were paid for the pre-approval. Preserved across renewals.

lastRenewedAt

Time

When the pre-approval was last renewed. Set equal to validFrom on creation and updated on each renewal.

expiresAt

Time

Provider selected timestamp defining the lifetime of the contract. Can be extended by renewing the contract.

Data Types

data AmuletRules_AddFutureAmuletConfigScheduleResult

data AmuletRules_AdvanceOpenMiningRoundsResult

AmuletRules_AdvanceOpenMiningRoundsResult

Field

Type

Description

summarizingRoundCid

ContractId SummarizingMiningRound

openRoundCid

ContractId OpenMiningRound

instance GetField "openRoundCid" AmuletRules_AdvanceOpenMiningRoundsResult (ContractId OpenMiningRound)

instance GetField "summarizingRoundCid" AmuletRules_AdvanceOpenMiningRoundsResult (ContractId SummarizingMiningRound)

instance SetField "openRoundCid" AmuletRules_AdvanceOpenMiningRoundsResult (ContractId OpenMiningRound)

instance SetField "summarizingRoundCid" AmuletRules_AdvanceOpenMiningRoundsResult (ContractId SummarizingMiningRound)

instance HasExercise AmuletRules AmuletRules_AdvanceOpenMiningRounds AmuletRules_AdvanceOpenMiningRoundsResult

instance HasFromAnyChoice AmuletRules AmuletRules_AdvanceOpenMiningRounds AmuletRules_AdvanceOpenMiningRoundsResult

instance HasToAnyChoice AmuletRules AmuletRules_AdvanceOpenMiningRounds AmuletRules_AdvanceOpenMiningRoundsResult

data AmuletRules_Bootstrap_RoundsResult

data AmuletRules_BuyMemberTrafficResult

AmuletRules_BuyMemberTrafficResult

Field

Type

Description

round

Round

summary

TransferSummary

amuletPaid

Decimal

purchasedTraffic

ContractId MemberTraffic

senderChangeAmulet

Optional (ContractId Amulet)

instance Eq AmuletRules_BuyMemberTrafficResult

instance Show AmuletRules_BuyMemberTrafficResult

instance GetField "amuletPaid" AmuletRules_BuyMemberTrafficResult Decimal

instance GetField "purchasedTraffic" AmuletRules_BuyMemberTrafficResult (ContractId MemberTraffic)

instance GetField "round" AmuletRules_BuyMemberTrafficResult Round

instance GetField "senderChangeAmulet" AmuletRules_BuyMemberTrafficResult (Optional (ContractId Amulet))

instance GetField "summary" AmuletRules_BuyMemberTrafficResult TransferSummary

instance SetField "amuletPaid" AmuletRules_BuyMemberTrafficResult Decimal

instance SetField "purchasedTraffic" AmuletRules_BuyMemberTrafficResult (ContractId MemberTraffic)

instance SetField "round" AmuletRules_BuyMemberTrafficResult Round

instance SetField "senderChangeAmulet" AmuletRules_BuyMemberTrafficResult (Optional (ContractId Amulet))

instance SetField "summary" AmuletRules_BuyMemberTrafficResult TransferSummary

instance HasExercise AmuletRules AmuletRules_BuyMemberTraffic AmuletRules_BuyMemberTrafficResult

instance HasFromAnyChoice AmuletRules AmuletRules_BuyMemberTraffic AmuletRules_BuyMemberTrafficResult

instance HasToAnyChoice AmuletRules AmuletRules_BuyMemberTraffic AmuletRules_BuyMemberTrafficResult

data AmuletRules_ClaimExpiredRewardsResult

data AmuletRules_ComputeFeesResult

data AmuletRules_CreateExternalPartySetupProposalResult

AmuletRules_CreateExternalPartySetupProposalResult

Field

Type

Description

proposalCid

ContractId ExternalPartySetupProposal

user

Party

validator

Party

transferResult

TransferResult

amuletPaid

Decimal

instance Eq AmuletRules_CreateExternalPartySetupProposalResult

instance Show AmuletRules_CreateExternalPartySetupProposalResult

instance GetField "amuletPaid" AmuletRules_CreateExternalPartySetupProposalResult Decimal

instance GetField "proposalCid" AmuletRules_CreateExternalPartySetupProposalResult (ContractId ExternalPartySetupProposal)

instance GetField "transferResult" AmuletRules_CreateExternalPartySetupProposalResult TransferResult

instance GetField "user" AmuletRules_CreateExternalPartySetupProposalResult Party

instance GetField "validator" AmuletRules_CreateExternalPartySetupProposalResult Party

instance SetField "amuletPaid" AmuletRules_CreateExternalPartySetupProposalResult Decimal

instance SetField "proposalCid" AmuletRules_CreateExternalPartySetupProposalResult (ContractId ExternalPartySetupProposal)

instance SetField "transferResult" AmuletRules_CreateExternalPartySetupProposalResult TransferResult

instance SetField "user" AmuletRules_CreateExternalPartySetupProposalResult Party

instance SetField "validator" AmuletRules_CreateExternalPartySetupProposalResult Party

instance HasExercise AmuletRules AmuletRules_CreateExternalPartySetupProposal AmuletRules_CreateExternalPartySetupProposalResult

instance HasFromAnyChoice AmuletRules AmuletRules_CreateExternalPartySetupProposal AmuletRules_CreateExternalPartySetupProposalResult

instance HasToAnyChoice AmuletRules AmuletRules_CreateExternalPartySetupProposal AmuletRules_CreateExternalPartySetupProposalResult

data AmuletRules_CreateTransferPreapprovalResult

AmuletRules_CreateTransferPreapprovalResult

Field

Type

Description

transferPreapprovalCid

ContractId TransferPreapproval

transferResult

TransferResult

amuletPaid

Decimal

instance Eq AmuletRules_CreateTransferPreapprovalResult

instance Show AmuletRules_CreateTransferPreapprovalResult

instance GetField "amuletPaid" AmuletRules_CreateTransferPreapprovalResult Decimal

instance GetField "transferPreapprovalCid" AmuletRules_CreateTransferPreapprovalResult (ContractId TransferPreapproval)

instance GetField "transferResult" AmuletRules_CreateTransferPreapprovalResult TransferResult

instance SetField "amuletPaid" AmuletRules_CreateTransferPreapprovalResult Decimal

instance SetField "transferPreapprovalCid" AmuletRules_CreateTransferPreapprovalResult (ContractId TransferPreapproval)

instance SetField "transferResult" AmuletRules_CreateTransferPreapprovalResult TransferResult

instance HasExercise AmuletRules AmuletRules_CreateTransferPreapproval AmuletRules_CreateTransferPreapprovalResult

instance HasFromAnyChoice AmuletRules AmuletRules_CreateTransferPreapproval AmuletRules_CreateTransferPreapprovalResult

instance HasToAnyChoice AmuletRules AmuletRules_CreateTransferPreapproval AmuletRules_CreateTransferPreapprovalResult

data AmuletRules_DevNet_FeatureAppResult

data AmuletRules_DevNet_TapResult

data AmuletRules_MergeMemberTrafficContractsResult

data AmuletRules_MergeUnclaimedRewardsResult

data AmuletRules_MiningRound_ArchiveResult

data AmuletRules_MiningRound_CloseResult

data AmuletRules_MiningRound_StartIssuingResult

data AmuletRules_MintResult

data AmuletRules_RemoveFutureAmuletConfigScheduleResult

data AmuletRules_UpdateFutureAmuletConfigScheduleResult

data AppTransferContext

data BalanceChange

BalanceChange

Field

Type

Description

changeToInitialAmountAsOfRoundZero

Decimal

The change to the total balance introduced by this balance change, normalized to round zero, i.e., a amulet created in round 3 is treated as a amulet created in round 0 with a higher initial amount.

changeToHoldingFeesRate

Decimal

The change of total holding fees introduced by this balance change.

instance Eq BalanceChange

instance Additive BalanceChange

instance Show BalanceChange

instance GetField "balanceChanges" TransferSummary (Map Party BalanceChange)

instance GetField "changeToHoldingFeesRate" BalanceChange Decimal

instance GetField "changeToInitialAmountAsOfRoundZero" BalanceChange Decimal

instance SetField "balanceChanges" TransferSummary (Map Party BalanceChange)

instance SetField "changeToHoldingFeesRate" BalanceChange Decimal

instance SetField "changeToInitialAmountAsOfRoundZero" BalanceChange Decimal

data CreatedAmulet

TransferResultAmulet (ContractId Amulet)

TransferResultLockedAmulet (ContractId LockedAmulet)

ExtCreatedAmulet

Field

Type

Description

dummyUnitField

()

Extension constructor (and field) to work around the current lack of upgrading for variants in Daml 3.0

instance Eq CreatedAmulet

instance Ord CreatedAmulet

instance Show CreatedAmulet

instance GetField "createdAmulets" TransferResult [CreatedAmulet]

instance GetField "dummyUnitField" CreatedAmulet ()

instance SetField "createdAmulets" TransferResult [CreatedAmulet]

instance SetField "dummyUnitField" CreatedAmulet ()

data ExternalPartySetupProposal_AcceptResult

ExternalPartySetupProposal_AcceptResult

Field

Type

Description

validatorRightCid

ContractId ValidatorRight

transferPreapprovalCid

ContractId TransferPreapproval

instance Eq ExternalPartySetupProposal_AcceptResult

instance Show ExternalPartySetupProposal_AcceptResult

instance GetField "transferPreapprovalCid" ExternalPartySetupProposal_AcceptResult (ContractId TransferPreapproval)

instance GetField "validatorRightCid" ExternalPartySetupProposal_AcceptResult (ContractId ValidatorRight)

instance SetField "transferPreapprovalCid" ExternalPartySetupProposal_AcceptResult (ContractId TransferPreapproval)

instance SetField "validatorRightCid" ExternalPartySetupProposal_AcceptResult (ContractId ValidatorRight)

instance HasExercise ExternalPartySetupProposal ExternalPartySetupProposal_Accept ExternalPartySetupProposal_AcceptResult

instance HasFromAnyChoice ExternalPartySetupProposal ExternalPartySetupProposal_Accept ExternalPartySetupProposal_AcceptResult

instance HasToAnyChoice ExternalPartySetupProposal ExternalPartySetupProposal_Accept ExternalPartySetupProposal_AcceptResult

data InvalidTransfer

data InvalidTransferReason

ITR_InsufficientFunds

Field

Type

Description

missingAmount

Decimal

ITR_UnknownSynchronizer

Field

Type

Description

synchronizerId

Text

ITR_InsufficientTopupAmount

Field

Type

Description

requestedTopupAmount

Int

minTopupAmount

Int

ITR_Other

Field

Type

Description

description

Text

ExtInvalidTransferReason

Field

Type

Description

dummyUnitField

()

Extension constructor (and field) to work around the current lack of upgrading for variants in Daml 3.0

instance Eq InvalidTransferReason

instance Show InvalidTransferReason

instance GetField "description" InvalidTransferReason Text

instance GetField "dummyUnitField" InvalidTransferReason ()

instance GetField "minTopupAmount" InvalidTransferReason Int

instance GetField "missingAmount" InvalidTransferReason Decimal

instance GetField "reason" InvalidTransfer InvalidTransferReason

instance GetField "reason" TransferCommandResult InvalidTransferReason

instance GetField "requestedTopupAmount" InvalidTransferReason Int

instance GetField "synchronizerId" InvalidTransferReason Text

instance SetField "description" InvalidTransferReason Text

instance SetField "dummyUnitField" InvalidTransferReason ()

instance SetField "minTopupAmount" InvalidTransferReason Int

instance SetField "missingAmount" InvalidTransferReason Decimal

instance SetField "reason" InvalidTransfer InvalidTransferReason

instance SetField "reason" TransferCommandResult InvalidTransferReason

instance SetField "requestedTopupAmount" InvalidTransferReason Int

instance SetField "synchronizerId" InvalidTransferReason Text

data PaymentTransferContext

PaymentTransferContext

Field

Type

Description

amuletRules

ContractId AmuletRules

context

TransferContext

instance Eq PaymentTransferContext

instance Show PaymentTransferContext

instance GetField "amuletRules" PaymentTransferContext (ContractId AmuletRules)

instance GetField "context" AmuletRules_CreateExternalPartySetupProposal PaymentTransferContext

instance GetField "context" AmuletRules_CreateTransferPreapproval PaymentTransferContext

instance GetField "context" PaymentTransferContext TransferContext

instance GetField "context" TransferPreapproval_Renew PaymentTransferContext

instance GetField "context" TransferPreapproval_Send PaymentTransferContext

instance GetField "context" TransferCommand_Send PaymentTransferContext

instance SetField "amuletRules" PaymentTransferContext (ContractId AmuletRules)

instance SetField "context" AmuletRules_CreateExternalPartySetupProposal PaymentTransferContext

instance SetField "context" AmuletRules_CreateTransferPreapproval PaymentTransferContext

instance SetField "context" PaymentTransferContext TransferContext

instance SetField "context" TransferPreapproval_Renew PaymentTransferContext

instance SetField "context" TransferPreapproval_Send PaymentTransferContext

instance SetField "context" TransferCommand_Send PaymentTransferContext

data PreprocessedTransferOutput

PreprocessedTransferOutput

Field

Type

Description

owner

Party

Owner of the output

outputFee

Decimal

Fee charged to create this output

amount

Decimal

Amount of amulet held by this output (after deducting fees)

lock

Optional TimeLock

Whether to lock the amulet or not

instance Eq PreprocessedTransferOutput

instance Show PreprocessedTransferOutput

instance GetField "amount" PreprocessedTransferOutput Decimal

instance GetField "lock" PreprocessedTransferOutput (Optional TimeLock)

instance GetField "outputFee" PreprocessedTransferOutput Decimal

instance GetField "owner" PreprocessedTransferOutput Party

instance SetField "amount" PreprocessedTransferOutput Decimal

instance SetField "lock" PreprocessedTransferOutput (Optional TimeLock)

instance SetField "outputFee" PreprocessedTransferOutput Decimal

instance SetField "owner" PreprocessedTransferOutput Party

data RewardsIssuanceConfig

An easy way to configure exucuteTransfer wrt what rewards to issue. We currently only use two configurations: but all of the options in here make sense, so we keep them.

RewardsIssuanceConfig

Field

Type

Description

issueAppRewards

Bool

issueValidatorRewards

Bool

instance GetField "issueAppRewards" RewardsIssuanceConfig Bool

instance GetField "issueValidatorRewards" RewardsIssuanceConfig Bool

instance SetField "issueAppRewards" RewardsIssuanceConfig Bool

instance SetField "issueValidatorRewards" RewardsIssuanceConfig Bool

data Transfer

Representation of a batch transfer.

Transfer

Field

Type

Description

sender

Party

provider

Party

inputs

[TransferInput]

outputs

[TransferOutput]

instance Eq Transfer

instance Ord Transfer

instance Show Transfer

instance GetField "inputs" Transfer [TransferInput]

instance GetField "outputs" Transfer [TransferOutput]

instance GetField "provider" Transfer Party

instance GetField "sender" Transfer Party

instance GetField "transfer" AmuletRules_Transfer Transfer

instance SetField "inputs" Transfer [TransferInput]

instance SetField "outputs" Transfer [TransferOutput]

instance SetField "provider" Transfer Party

instance SetField "sender" Transfer Party

instance SetField "transfer" AmuletRules_Transfer Transfer

data TransferContext

Contracts that need to be passed in to a Transfer so that we can reference them by contract id instead of by key.

TransferContext

Field

Type

Description

openMiningRound

ContractId OpenMiningRound

issuingMiningRounds

Map Round (ContractId IssuingMiningRound)

validatorRights

Map Party (ContractId ValidatorRight)

Map from user to ValidatorRight contract.

featuredAppRight

Optional (ContractId FeaturedAppRight)

Optional proof that the provider is a featured app provider.

instance Eq TransferContext

instance Show TransferContext

instance GetField "context" AmuletRules_BuyMemberTraffic TransferContext

instance GetField "context" AmuletRules_ComputeFees TransferContext

instance GetField "context" AmuletRules_Transfer TransferContext

instance GetField "context" PaymentTransferContext TransferContext

instance GetField "featuredAppRight" TransferContext (Optional (ContractId FeaturedAppRight))

instance GetField "issuingMiningRounds" TransferContext (Map Round (ContractId IssuingMiningRound))

instance GetField "openMiningRound" TransferContext (ContractId OpenMiningRound)

instance GetField "validatorRights" TransferContext (Map Party (ContractId ValidatorRight))

instance SetField "context" AmuletRules_BuyMemberTraffic TransferContext

instance SetField "context" AmuletRules_ComputeFees TransferContext

instance SetField "context" AmuletRules_Transfer TransferContext

instance SetField "context" PaymentTransferContext TransferContext

instance SetField "featuredAppRight" TransferContext (Optional (ContractId FeaturedAppRight))

instance SetField "issuingMiningRounds" TransferContext (Map Round (ContractId IssuingMiningRound))

instance SetField "openMiningRound" TransferContext (ContractId OpenMiningRound)

instance SetField "validatorRights" TransferContext (Map Party (ContractId ValidatorRight))

data TransferContextSummary

TransferContextSummary

Field

Type

Description

featuredAppProvider

Optional Party

config

TransferConfig Amulet

openRound

OpenMiningRound

issuingMiningRounds

Map Round IssuingMiningRound

validatorRights

Map Party (ContractId ValidatorRight)

instance Eq TransferContextSummary

instance Show TransferContextSummary

instance GetField "config" TransferContextSummary (TransferConfig Amulet)

instance GetField "featuredAppProvider" TransferContextSummary (Optional Party)

instance GetField "issuingMiningRounds" TransferContextSummary (Map Round IssuingMiningRound)

instance GetField "openRound" TransferContextSummary OpenMiningRound

instance GetField "validatorRights" TransferContextSummary (Map Party (ContractId ValidatorRight))

instance SetField "config" TransferContextSummary (TransferConfig Amulet)

instance SetField "featuredAppProvider" TransferContextSummary (Optional Party)

instance SetField "issuingMiningRounds" TransferContextSummary (Map Round IssuingMiningRound)

instance SetField "openRound" TransferContextSummary OpenMiningRound

instance SetField "validatorRights" TransferContextSummary (Map Party (ContractId ValidatorRight))

data TransferInput

An individual input for a batch transfer.

InputAppRewardCoupon (ContractId AppRewardCoupon)

InputValidatorRewardCoupon (ContractId ValidatorRewardCoupon)

InputSvRewardCoupon (ContractId SvRewardCoupon)

InputAmulet (ContractId Amulet)

ExtTransferInput

Field

Type

Description

dummyUnitField

()

Extension constructor (and field) to work around the current lack of upgrading for variants in Daml 3.0

optInputValidatorFaucetCoupon

Optional (ContractId ValidatorFaucetCoupon)

Added in CIP-3. Optional validator faucet coupon input into this transfer.

InputValidatorLivenessActivityRecord (ContractId ValidatorLivenessActivityRecord)

instance Eq TransferInput

instance Ord TransferInput

instance Show TransferInput

instance GetField "dummyUnitField" TransferInput ()

instance GetField "inputs" AmuletRules_BuyMemberTraffic [TransferInput]

instance GetField "inputs" AmuletRules_CreateExternalPartySetupProposal [TransferInput]

instance GetField "inputs" AmuletRules_CreateTransferPreapproval [TransferInput]

instance GetField "inputs" Transfer [TransferInput]

instance GetField "inputs" TransferPreapproval_Renew [TransferInput]

instance GetField "inputs" TransferPreapproval_Send [TransferInput]

instance GetField "inputs" TransferCommand_Send [TransferInput]

instance GetField "optInputValidatorFaucetCoupon" TransferInput (Optional (ContractId ValidatorFaucetCoupon))

instance SetField "dummyUnitField" TransferInput ()

instance SetField "inputs" AmuletRules_BuyMemberTraffic [TransferInput]

instance SetField "inputs" AmuletRules_CreateExternalPartySetupProposal [TransferInput]

instance SetField "inputs" AmuletRules_CreateTransferPreapproval [TransferInput]

instance SetField "inputs" Transfer [TransferInput]

instance SetField "inputs" TransferPreapproval_Renew [TransferInput]

instance SetField "inputs" TransferPreapproval_Send [TransferInput]

instance SetField "inputs" TransferCommand_Send [TransferInput]

instance SetField "optInputValidatorFaucetCoupon" TransferInput (Optional (ContractId ValidatorFaucetCoupon))

data TransferInputsSummary

TransferInputsSummary

Field

Type

Description

totalAmuletAmount

Decimal

totalAppRewardAmount

Decimal

totalValidatorRewardAmount

Decimal

totalValidatorFaucetAmount

Decimal

Note that the validator faucet amount does not need to be optional in this type, as it is not stored on the ledger.

totalSvRewardAmount

Decimal

totalHoldingFees

Decimal

amountArchivedAsOfRoundZero

Decimal

changeToHoldingFeesRate

Decimal

instance Eq TransferInputsSummary

instance Show TransferInputsSummary

instance GetField "amountArchivedAsOfRoundZero" TransferInputsSummary Decimal

instance GetField "changeToHoldingFeesRate" TransferInputsSummary Decimal

instance GetField "totalAmuletAmount" TransferInputsSummary Decimal

instance GetField "totalAppRewardAmount" TransferInputsSummary Decimal

instance GetField "totalHoldingFees" TransferInputsSummary Decimal

instance GetField "totalSvRewardAmount" TransferInputsSummary Decimal

instance GetField "totalValidatorFaucetAmount" TransferInputsSummary Decimal

instance GetField "totalValidatorRewardAmount" TransferInputsSummary Decimal

instance SetField "amountArchivedAsOfRoundZero" TransferInputsSummary Decimal

instance SetField "changeToHoldingFeesRate" TransferInputsSummary Decimal

instance SetField "totalAmuletAmount" TransferInputsSummary Decimal

instance SetField "totalAppRewardAmount" TransferInputsSummary Decimal

instance SetField "totalHoldingFees" TransferInputsSummary Decimal

instance SetField "totalSvRewardAmount" TransferInputsSummary Decimal

instance SetField "totalValidatorFaucetAmount" TransferInputsSummary Decimal

instance SetField "totalValidatorRewardAmount" TransferInputsSummary Decimal

data TransferOutput

An individual output for a batch transfer.

TransferOutput

Field

Type

Description

receiver

Party

The receiver who will own the created output amulet.

receiverFeeRatio

Decimal

The ratio of the output fee paid from receiver’s output amount. 1.0 means the whole fee is deducted from the specified output amount, 0.0 the whole fee is deducted from the sender’s input balance. If a receiver’s fee is not covered by the specified output amount, the transfer is aborted.

amount

Decimal

The amount of amulet to receive, before deducting the receiver’s part of the output fee.

lock

Optional TimeLock

The lock to be added, if any.

instance Eq TransferOutput

instance Ord TransferOutput

instance Show TransferOutput

instance GetField "amount" TransferOutput Decimal

instance GetField "lock" TransferOutput (Optional TimeLock)

instance GetField "outputs" AmuletRules_ComputeFees [TransferOutput]

instance GetField "outputs" Transfer [TransferOutput]

instance GetField "receiver" TransferOutput Party

instance GetField "receiverFeeRatio" TransferOutput Decimal

instance SetField "amount" TransferOutput Decimal

instance SetField "lock" TransferOutput (Optional TimeLock)

instance SetField "outputs" AmuletRules_ComputeFees [TransferOutput]

instance SetField "outputs" Transfer [TransferOutput]

instance SetField "receiver" TransferOutput Party

instance SetField "receiverFeeRatio" TransferOutput Decimal

type TransferOutputsSummary

= [PreprocessedTransferOutput]

data TransferPreapproval_CancelResult

data TransferPreapproval_ExpireResult

data TransferPreapproval_RenewResult

TransferPreapproval_RenewResult

Field

Type

Description

transferPreapprovalCid

ContractId TransferPreapproval

transferResult

TransferResult

receiver

Party

provider

Party

amuletPaid

Decimal

instance Eq TransferPreapproval_RenewResult

instance Show TransferPreapproval_RenewResult

instance GetField "amuletPaid" TransferPreapproval_RenewResult Decimal

instance GetField "provider" TransferPreapproval_RenewResult Party

instance GetField "receiver" TransferPreapproval_RenewResult Party

instance GetField "transferPreapprovalCid" TransferPreapproval_RenewResult (ContractId TransferPreapproval)

instance GetField "transferResult" TransferPreapproval_RenewResult TransferResult

instance SetField "amuletPaid" TransferPreapproval_RenewResult Decimal

instance SetField "provider" TransferPreapproval_RenewResult Party

instance SetField "receiver" TransferPreapproval_RenewResult Party

instance SetField "transferPreapprovalCid" TransferPreapproval_RenewResult (ContractId TransferPreapproval)

instance SetField "transferResult" TransferPreapproval_RenewResult TransferResult

instance HasExercise TransferPreapproval TransferPreapproval_Renew TransferPreapproval_RenewResult

instance HasFromAnyChoice TransferPreapproval TransferPreapproval_Renew TransferPreapproval_RenewResult

instance HasToAnyChoice TransferPreapproval TransferPreapproval_Renew TransferPreapproval_RenewResult

data TransferPreapproval_SendResult

data TransferResult

TransferResult

Field

Type

Description

round

Round

Round for which this transfer was registered.

summary

TransferSummary

Summary of amount input and outputs, and fees paid.

createdAmulets

[CreatedAmulet]

References to the created output amulets.

senderChangeAmulet

Optional (ContractId Amulet)

Optional reference to the amulet for the change returned to the sender. Only created if there was some change to be returned after deducting the fee for returning change.

instance Eq TransferResult

instance Show TransferResult

instance GetField "createdAmulets" TransferResult [CreatedAmulet]

instance GetField "result" TransferPreapproval_SendResult TransferResult

instance GetField "result" TransferCommandResult TransferResult

instance GetField "round" TransferResult Round

instance GetField "senderChangeAmulet" TransferResult (Optional (ContractId Amulet))

instance GetField "summary" TransferResult TransferSummary

instance GetField "transferResult" AmuletRules_CreateExternalPartySetupProposalResult TransferResult

instance GetField "transferResult" AmuletRules_CreateTransferPreapprovalResult TransferResult

instance GetField "transferResult" TransferPreapproval_RenewResult TransferResult

instance SetField "createdAmulets" TransferResult [CreatedAmulet]

instance SetField "result" TransferPreapproval_SendResult TransferResult

instance SetField "result" TransferCommandResult TransferResult

instance SetField "round" TransferResult Round

instance SetField "senderChangeAmulet" TransferResult (Optional (ContractId Amulet))

instance SetField "summary" TransferResult TransferSummary

instance SetField "transferResult" AmuletRules_CreateExternalPartySetupProposalResult TransferResult

instance SetField "transferResult" AmuletRules_CreateTransferPreapprovalResult TransferResult

instance SetField "transferResult" TransferPreapproval_RenewResult TransferResult

instance HasExercise AmuletRules AmuletRules_Transfer TransferResult

instance HasFromAnyChoice AmuletRules AmuletRules_Transfer TransferResult

instance HasToAnyChoice AmuletRules AmuletRules_Transfer TransferResult

data TransferSummary

Summary of input and output amounts and fees paid. This summary is intended to be used together with the Transfer specification used to initiate the transfer when displaying a transaction summary. Its fields are intended to provide shortcuts for key numbers that are complex to compute off-ledger.

All amounts are denominated in Splice.

TransferSummary

Field

Type

Description

inputAppRewardAmount

Decimal

Total amount of app reward coupon issunace input into this transfer.

inputValidatorRewardAmount

Decimal

Total amount of validator rewards coupon issuance input into this transfer.

inputSvRewardAmount

Decimal

Total amount of SV reward coupon issuance input into this transfer.

inputAmuletAmount

Decimal

Total input amount of amulet input into this transfer, before deducting holding fees.

balanceChanges

Map Party BalanceChange

Balance changes per party

holdingFees

Decimal

Holding fees paid by the sender on their input amulets.

outputFees

[Decimal]

Fees paid for the individual output amulets in the order they were specified.

senderChangeFee

Decimal

Fee charged for returning change to the sender, which is the smaller of the left-over balance after paying for all outputs or one amulet create fee. In case the left-over balance after paying for all outputs is smaller than a create fee, all of that balance is consumed by the fee for returning change, and no actual amulet is created for the sender, i.e., the senderChangeAmount is zero. The transfer does though succeed. For transfers that do not allow returning change to the sender, the left-over balance after paying for all outputs must be zero, and thus the senderChangeFee must be zero as well.

senderChangeAmount

Decimal

The final amount of amulet returned to the sender after paying for all outputs and fees. If it is zero, then no amulet is created for the sender.

amuletPrice

Decimal

The amulet price at the round this transfer was executed.

inputValidatorFaucetAmount

Optional Decimal

Added in CIP-3. Total amount of validator faucet coupon issuance input into this transfer.

instance Eq TransferSummary

instance Show TransferSummary

instance GetField "amuletPrice" TransferSummary Decimal

instance GetField "balanceChanges" TransferSummary (Map Party BalanceChange)

instance GetField "holdingFees" TransferSummary Decimal

instance GetField "inputAmuletAmount" TransferSummary Decimal

instance GetField "inputAppRewardAmount" TransferSummary Decimal

instance GetField "inputSvRewardAmount" TransferSummary Decimal

instance GetField "inputValidatorFaucetAmount" TransferSummary (Optional Decimal)

instance GetField "inputValidatorRewardAmount" TransferSummary Decimal

instance GetField "outputFees" TransferSummary [Decimal]

instance GetField "senderChangeAmount" TransferSummary Decimal

instance GetField "senderChangeFee" TransferSummary Decimal

instance GetField "summary" AmuletRules_BuyMemberTrafficResult TransferSummary

instance GetField "summary" TransferResult TransferSummary

instance SetField "amuletPrice" TransferSummary Decimal

instance SetField "balanceChanges" TransferSummary (Map Party BalanceChange)

instance SetField "holdingFees" TransferSummary Decimal

instance SetField "inputAmuletAmount" TransferSummary Decimal

instance SetField "inputAppRewardAmount" TransferSummary Decimal

instance SetField "inputSvRewardAmount" TransferSummary Decimal

instance SetField "inputValidatorFaucetAmount" TransferSummary (Optional Decimal)

instance SetField "inputValidatorRewardAmount" TransferSummary Decimal

instance SetField "outputFees" TransferSummary [Decimal]

instance SetField "senderChangeAmount" TransferSummary Decimal

instance SetField "senderChangeFee" TransferSummary Decimal

instance SetField "summary" AmuletRules_BuyMemberTrafficResult TransferSummary

instance SetField "summary" TransferResult TransferSummary

Functions

transferControllers

: Transfer -> Set Party

The controllers for a transfer.

scaleAmuletConfig

: Decimal -> AmuletConfig USD -> AmuletConfig Amulet

computeFees

: Party -> TransferContext -> Party -> [TransferOutput] -> Update [Decimal]

computeOutputFee

: TransferConfig Amulet -> Party -> TransferOutput -> Decimal

checkTransferConstraints

: Transfer -> TransferSummary -> TransferConfig Amulet -> Either InvalidTransferReason ()

executeTransfer

: RewardsIssuanceConfig -> TransferContext -> Party -> Transfer -> Update TransferResult

Execute a transfer.

summarizeAndValidateContext

: TransferContext -> Party -> Transfer -> Update TransferContextSummary

getValidatorRight

: TransferContextSummary -> Party -> Update (ContractId ValidatorRight)

getIssuingMiningRound

: TransferContextSummary -> Round -> Update IssuingMiningRound

summarizeAndConsumeInputs

: TransferContextSummary -> Party -> Party -> [TransferInput] -> Update TransferInputsSummary

dedupOutputLockHolders

: TransferOutput -> TransferOutput

Deduplicate lock-holders to store them and charge for them at most once

preprocessOutputs

: TransferConfig Amulet -> Party -> [TransferOutput] -> Update TransferOutputsSummary

summarizeTransfer

: Party -> OpenMiningRound -> TransferConfig Amulet -> TransferInputsSummary -> TransferOutputsSummary -> Update TransferSummary

issueRewards

: RewardsIssuanceConfig -> TransferContextSummary -> Party -> Party -> TransferSummary -> Update ()

createTransferOutputs

: OpenMiningRound -> TransferConfig Amulet -> Party -> Party -> TransferSummary -> TransferOutputsSummary -> Update ([CreatedAmulet], Optional (ContractId Amulet))

scaleFees

: Decimal -> TransferConfig USD -> TransferConfig Amulet

Scale the ‘AmuletConfig’ such that the fees charged are scaled by the same scale factor.

transferConfigAmuletFromOpenRound

: OpenMiningRound -> TransferConfig Amulet

validateBuyMemberTrafficInputs

: AmuletConfig USD -> Text -> Int -> Either InvalidTransferReason ()

computeSynchronizerFees

: Party -> Int -> AmuletRules -> TransferContext -> Update (Decimal, Decimal)

Computing synchronizer fees

exerciseAppTransfer

: AppTransferContext -> Transfer -> Update TransferResult

exercisePaymentTransfer

: PaymentTransferContext -> Transfer -> Update TransferResult

exerciseComputeFees

: PaymentTransferContext -> Party -> [TransferOutput] -> Update [Decimal]

amuletTransferContext

: ContractId OpenMiningRound -> Optional (ContractId FeaturedAppRight) -> TransferContext

Helper to construct transfer context with only amulet inputs

mkInputValidatorFaucetCoupon

: ContractId ValidatorFaucetCoupon -> TransferInput

Smart constructor for inputing validator faucet coupons into a transfer.

computeTransferPreapprovalFee

: RelTime -> AmuletConfig USD -> TransferContext -> Party -> Update (Decimal, Decimal)

chargeTransferPreapprovalFee

: Party -> Decimal -> [TransferInput] -> PaymentTransferContext -> Party -> Update TransferResult