public static class OnLedgerAsset.Companion
Modifier and Type | Method and Description |
---|---|
<S extends FungibleAsset<T>,T> |
generateExit(TransactionBuilder tx,
Amount<net.corda.core.contracts.Issued> amountIssued,
java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> assetStates,
Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState,
Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand,
Function1<? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? extends net.corda.core.contracts.CommandData> generateExitCommand)
Deprecated.
|
<S extends FungibleAsset<T>,T> |
generateExit(TransactionBuilder tx,
Amount<net.corda.core.contracts.Issued> amountIssued,
java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> assetStates,
AbstractParty payChangeTo,
Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState,
Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand,
Function1<? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? extends net.corda.core.contracts.CommandData> generateExitCommand)
Generate an transaction exiting fungible assets from the ledger.
|
<S extends FungibleAsset<T>,T> |
generateIssue(TransactionBuilder tx,
TransactionState<? extends S> transactionState,
CommandData issueCommand)
Puts together an issuance transaction for the specified state. Normally contracts will provide convenient
wrappers around this function, which build the state for you, and those should be used in preference.
|
<S extends FungibleAsset<T>,T> |
generateSpend(TransactionBuilder tx,
Amount<T> amount,
AbstractParty to,
java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> acceptableStates,
AbstractParty payChangeTo,
Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState,
Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand)
Generate a transaction that moves an amount of currency to the given pubkey.
|
<S extends FungibleAsset<T>,T> |
generateSpend(TransactionBuilder tx,
java.util.List<net.corda.finance.contracts.asset.PartyAndAmount> payments,
java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> acceptableStates,
AbstractParty payChangeTo,
Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState,
Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand)
Adds to the given transaction states that move amounts of a fungible asset to the given parties, using only
the provided acceptable input states to find a solution (not all of them may be used in the end). A change
output will be generated if the state amounts don't exactly fit.
|
public <S extends FungibleAsset<T>,T> NonExistentClass generateSpend(TransactionBuilder tx, Amount<T> amount, AbstractParty to, java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> acceptableStates, AbstractParty payChangeTo, Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState, Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand)
Generate a transaction that moves an amount of currency to the given pubkey.
Note: an class Amount
of Currency is only fungible for a given Issuer Party within a interface FungibleAsset
tx
- A builder, which may contain inputs, outputs and commands already. The relevant components needed
to move the cash will be added on top.amount
- How much currency to send.to
- a key of the recipient.acceptableStates
- a list of acceptable input states to use.payChangeTo
- party to pay any change to; this is normally a confidential identity of the calling
party.deriveState
- a function to derive an output state based on an input state, amount for the output
and public key to pay to.class Amount
,
Currency,
interface FungibleAsset
public <S extends FungibleAsset<T>,T> NonExistentClass generateSpend(TransactionBuilder tx, java.util.List<net.corda.finance.contracts.asset.PartyAndAmount> payments, java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> acceptableStates, AbstractParty payChangeTo, Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState, Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand)
Adds to the given transaction states that move amounts of a fungible asset to the given parties, using only the provided acceptable input states to find a solution (not all of them may be used in the end). A change output will be generated if the state amounts don't exactly fit.
The fungible assets must all be of the same type and the amounts must be summable i.e. amounts of the same token.
T
- A type representing a tokenS
- A fungible asset state typetx
- A builder, which may contain inputs, outputs and commands already. The relevant components needed
to move the cash will be added on top.acceptableStates
- a list of acceptable input states to use.payChangeTo
- party to pay any change to; this is normally a confidential identity of the calling
party. We use a new confidential identity here so that the recipient is not identifiable.deriveState
- a function to derive an output state based on an input state, amount for the output
and public key to pay to.public <S extends FungibleAsset<T>,T> java.util.Set<java.security.PublicKey> generateExit(TransactionBuilder tx, Amount<net.corda.core.contracts.Issued> amountIssued, java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> assetStates, Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState, Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand, Function1<? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? extends net.corda.core.contracts.CommandData> generateExitCommand)
Generate an transaction exiting fungible assets from the ledger.
tx
- transaction builder to add states and commands to.amountIssued
- the amount to be exited, represented as a quantity of issued currency.assetStates
- the asset states to take funds from. No checks are done about ownership of these states, it is
the responsibility of the caller to check that they do not attempt to exit funds held by others.public <S extends FungibleAsset<T>,T> java.util.Set<java.security.PublicKey> generateExit(TransactionBuilder tx, Amount<net.corda.core.contracts.Issued> amountIssued, java.util.List<? extends net.corda.core.contracts.StateAndRef<? extends S>> assetStates, AbstractParty payChangeTo, Function3<? super net.corda.core.contracts.TransactionState<? extends S>,? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? super net.corda.core.identity.AbstractParty,? extends net.corda.core.contracts.TransactionState<? extends S>> deriveState, Function0<? extends net.corda.core.contracts.CommandData> generateMoveCommand, Function1<? super net.corda.core.contracts.Amount<net.corda.core.contracts.Issued<T>>,? extends net.corda.core.contracts.CommandData> generateExitCommand)
Generate an transaction exiting fungible assets from the ledger.
tx
- transaction builder to add states and commands to.amountIssued
- the amount to be exited, represented as a quantity of issued currency.assetStates
- the asset states to take funds from. No checks are done about ownership of these states, it is
the responsibility of the caller to check that they do not attempt to exit funds held by others.payChangeTo
- party to pay any change to; this is normally a confidential identity of the calling
party.public <S extends FungibleAsset<T>,T> java.util.Set<java.security.PublicKey> generateIssue(TransactionBuilder tx, TransactionState<? extends S> transactionState, CommandData issueCommand)
Puts together an issuance transaction for the specified state. Normally contracts will provide convenient wrappers around this function, which build the state for you, and those should be used in preference.