Recipe class
Wrapper object for a recipe. These can be retrieved from a number of queries and operations, or created using an id alone. In the latter case, the recipe is considered partial, and does not support any operations other than executing it.
Note that partial recipes are not guaranteed to exist on chain; make sure your ID is correct when using them. However, since partial recipes do not need to be retrieved before use, they enable a smoother user experience.
Constructors
- Recipe(Recipe? _native, String? _forcedId)
- Recipe.fromId(String n)
- Recipe.fromRecipe(Recipe n)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
executeWith(
Profile prf, List< Item> inputs, {int CoinInputIndex = 0, List<PaymentInfo> paymentInfoGen()?}) → Future<Execution> - Executes the provided recipe using the provided profile and item inputs, and returns an execution. If the execution fails, returns an error instead. Because executions are currently not working, all you really get out of this is "the transaction didn't fail." If you need specific outputs after executing a recipe, you'll have to retrieve those from the user profile manually.
-
getCoinInputs(
) → Map< String, Int64> - Retrieves a map of all coins consumed upon execution of this recipe. If the user's profile doesn't have enough of any of these coins, the execution will fail.
-
getCookbookId(
) → String - Retrieves the ID of the recipe's associated cookbook.
-
getCreatedAt(
) → Int64 - Retrieves the block height as of this recipe's creation.
-
getDescription(
) → String - Retrieves the human-readable description of the recipe.
-
getExtraInfo(
) → String - Retrieves the recipe's extra info field. This can be used for additional human-readable details, or for metadata for tools that work directly with recipes.
-
getId(
) → String - Retrieves the ID of the recipe.
-
getItemInputs(
) → List< ItemInput> - Retrieves a list of all item input patterns contained by this recipe. If the items provided during execution do not contain matches for each of these patterns, the execution will fail.
-
getName(
) → String - Retrieves the human-readable name of the recipe.
-
getNodeVersion(
) → Int64 - Retrieves the node version of this recipe. Since all recipes are retrieved from the chain, this should generally just be the current version; don't worry about it.
-
getOutput(
) → OutputSet - Retrieves all output data for this recipe. See OutputSet and its child elements for more details.
-
getUpdatedAt(
) → Int64 - Retrieves the block height as of this recipe's last update.
-
getVersion(
) → String - Retrieves the version of the recipe. This is a SemVer string.
-
isEnabled(
) → bool - Is the recipe enabled?
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String id, {String? cookbook}) → Future< Recipe?> - Retrieves the current state of a recipe from the chain. If cookbook is specified manually, you can override the loaded cookbook or query a recipe before loading a cookbook; otherwise, the recipe will be retrieved for the loaded cookbook.
-
let(
String id) → Recipe - Produces a partial recipe for the provided ID and the current cookbook.