-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: releasing new utility with new packaging (#18)
- Loading branch information
1 parent
4ca67c6
commit d3b92e2
Showing
16 changed files
with
212 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//// Vodka provides utility functions to build CIP onchain code | ||
//// | ||
//// ### Example usage | ||
//// ```aiken | ||
//// use cip | ||
//// use cardano/assets.{AssetName} | ||
//// | ||
//// let cip68_100_asset_name = cip.cip68_100(asset_name); | ||
//// let cip68_222_asset_name = cip.cip68_222(asset_name); | ||
//// let cip68_333_asset_name = cip.cip68_333(asset_name); | ||
//// let cip68_444_asset_name = cip.cip68_444(asset_name); | ||
|
||
use aiken/primitive/bytearray.{concat} | ||
use cardano/assets.{AssetName} | ||
|
||
/// The byte prefix for CIP-68 asset - Reference Token | ||
pub const cip68_100_prefix: ByteArray = #"000643b0" | ||
|
||
/// The byte prefix for CIP-68 asset - Non-Fungible Token | ||
pub const cip68_222_prefix: ByteArray = #"000de140" | ||
|
||
/// The byte prefix for CIP-68 asset - Fungible Token | ||
pub const cip68_333_prefix: ByteArray = #"0014df10" | ||
|
||
/// The byte prefix for CIP-68 asset - Rich-Fungible Token | ||
pub const cip68_444_prefix: ByteArray = #"001bc280" | ||
|
||
/// Obtain the asset name for CIP-68 asset - Reference Token | ||
/// ```aiken | ||
/// let cip68_100_asset_name = cip68_100(asset_name); | ||
/// ``` | ||
pub fn cip68_100(asset_name: AssetName) -> AssetName { | ||
concat(cip68_100_prefix, asset_name) | ||
} | ||
|
||
/// Obtain the asset name for CIP-68 asset - Non-Fungible Token | ||
/// ```aiken | ||
/// let cip68_222_asset_name = cip68_222(asset_name); | ||
/// ``` | ||
pub fn cip68_222(asset_name: AssetName) -> AssetName { | ||
concat(cip68_222_prefix, asset_name) | ||
} | ||
|
||
/// Obtain the asset name for CIP-68 asset - Fungible Token | ||
/// ```aiken | ||
/// let cip68_333_asset_name = cip68_333(asset_name); | ||
/// ``` | ||
pub fn cip68_333(asset_name: AssetName) -> AssetName { | ||
concat(cip68_333_prefix, asset_name) | ||
} | ||
|
||
/// Obtain the asset name for CIP-68 asset - Rich-Fungible Token | ||
/// ```aiken | ||
/// let cip68_444_asset_name = cip68_444(asset_name); | ||
/// ``` | ||
pub fn cip68_444(asset_name: AssetName) -> AssetName { | ||
concat(cip68_444_prefix, asset_name) | ||
} | ||
|
||
/// The metadata attached with CIP-68 reference token (100) | ||
pub type CIP68Metadata { | ||
metadata: Pairs<Data, Data>, | ||
version: Int, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,155 @@ | ||
//// Vodka cocktail provides utility functions to build Aiken onchain code | ||
//// | ||
//// All onchain utility functions are grouped with a naming convention of `vodka_<type>`: | ||
//// All onchain utility functions are grouped with a naming convention of `vodka_<type>`, | ||
//// and all can be imported directly with `use cocktail` | ||
//// | ||
//// ### Cardano data types | ||
//// - `Address` - [`use vodka_address`](./vodka_address.html) | ||
//// - `Value` - [`use vodka_value`](./vodka_value.html) | ||
//// - `Address` - [`use vodka_address`](./cocktail/vodka_address.html) | ||
//// - `Value` - [`use vodka_value`](./cocktail/vodka_value.html) | ||
//// | ||
//// ### Transaction types | ||
//// - `extra_signatories` - [`use vodka_extra_signatories`](./vodka_extra_signatories.html) | ||
//// - `inputs` - [`use vodka_inputs`](./vodka_inputs.html) | ||
//// - `outputs` - [`use vodka_outputs`](./vodka_outputs.html) | ||
//// - `mints` - [`use vodka_mints`](./vodka_mints.html) | ||
//// - `validity_range` - [`use vodka_validity_range`](./vodka_validity_range.html) | ||
//// - `Redeemers` - [`use vodka_redeemers`](./vodka_redeemers.html) | ||
|
||
use vodka_address | ||
use vodka_converter | ||
use vodka_extra_signatories | ||
use vodka_inputs | ||
use vodka_mints | ||
use vodka_outputs | ||
use vodka_redeemers | ||
use vodka_validity_range | ||
use vodka_value | ||
//// - `extra_signatories` - [Documentation](./cocktail/vodka_extra_signatories.html) | ||
//// - `inputs` - [Documentation](./cocktail/vodka_inputs.html) | ||
//// - `outputs` - [Documentation](./cocktail/vodka_outputs.html) | ||
//// - `mints` - [Documentation](./cocktail/vodka_mints.html) | ||
//// - `validity_range` - [Documentation](./cocktail/vodka_validity_range.html) | ||
//// - `Redeemers` - [Documentation](./cocktail/vodka_redeemers.html) | ||
|
||
use cocktail/vodka_address | ||
use cocktail/vodka_converter | ||
use cocktail/vodka_extra_signatories | ||
use cocktail/vodka_inputs | ||
use cocktail/vodka_mints | ||
use cocktail/vodka_outputs | ||
use cocktail/vodka_redeemers | ||
use cocktail/vodka_validity_range | ||
use cocktail/vodka_value | ||
|
||
// Address | ||
|
||
/// Documentation please refer to [`vodka_address`](./cocktail/vodka_address.html) | ||
pub const compare_script_address = vodka_address.compare_script_address | ||
|
||
/// Documentation please refer to [`vodka_address`](./cocktail/vodka_address.html) | ||
pub const compare_address = vodka_address.compare_address | ||
|
||
/// Documentation please refer to [`vodka_address`](./cocktail/vodka_address.html) | ||
pub const address_pub_key = vodka_address.address_pub_key | ||
|
||
/// Documentation please refer to [`vodka_address`](./cocktail/vodka_address.html) | ||
pub const address_script_hash = vodka_address.address_script_hash | ||
|
||
// Converter | ||
|
||
/// Documentation please refer to [`vodka_converter`](./cocktail/vodka_converter.html) | ||
pub const convert_int_to_bytes = vodka_converter.convert_int_to_bytes | ||
|
||
/// Documentation please refer to [`vodka_converter`](./cocktail/vodka_converter.html) | ||
pub const get_number_digit = vodka_converter.get_number_digit | ||
|
||
// Extra Signatories | ||
|
||
/// Documentation please refer to [`vodka_extra_signatories`](./cocktail/vodka_extra_signatories.html) | ||
pub const key_signed = vodka_extra_signatories.key_signed | ||
|
||
/// Documentation please refer to [`vodka_extra_signatories`](./cocktail/vodka_extra_signatories.html) | ||
pub const one_of_keys_signed = vodka_extra_signatories.one_of_keys_signed | ||
|
||
/// Documentation please refer to [`vodka_extra_signatories`](./cocktail/vodka_extra_signatories.html) | ||
pub const all_key_signed = vodka_extra_signatories.all_key_signed | ||
|
||
// Inputs | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const input_inline_datum = vodka_inputs.input_inline_datum | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const only_input_datum_with = vodka_inputs.only_input_datum_with | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const inputs_at = vodka_inputs.inputs_at | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const inputs_with = vodka_inputs.inputs_with | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const inputs_with_policy = vodka_inputs.inputs_with_policy | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const inputs_at_with = vodka_inputs.inputs_at_with | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const inputs_at_with_policy = vodka_inputs.inputs_at_with_policy | ||
|
||
/// Documentation please refer to [`vodka_inputs`](./cocktail/vodka_inputs.html) | ||
pub const inputs_token_quantity = vodka_inputs.inputs_token_quantity | ||
|
||
// Mints | ||
|
||
/// Documentation please refer to [`vodka_mints`](./cocktail/vodka_mints.html) | ||
pub const check_policy_only_burn = vodka_mints.check_policy_only_burn | ||
|
||
/// Documentation please refer to [`vodka_mints`](./cocktail/vodka_mints.html) | ||
pub const only_minted_token = vodka_mints.only_minted_token | ||
|
||
/// Documentation please refer to [`vodka_mints`](./cocktail/vodka_mints.html) | ||
pub const token_minted = vodka_mints.token_minted | ||
|
||
// Outputs | ||
|
||
/// Documentation please refer to [`vodka_outputs`](./cocktail/vodka_outputs.html) | ||
pub const output_inline_datum = vodka_outputs.output_inline_datum | ||
|
||
/// Documentation please refer to [`vodka_outputs`](./cocktail/vodka_outputs.html) | ||
pub const outputs_at = vodka_outputs.outputs_at | ||
|
||
/// Documentation please refer to [`vodka_outputs`](./cocktail/vodka_outputs.html) | ||
pub const outputs_with = vodka_outputs.outputs_with | ||
|
||
/// Documentation please refer to [`vodka_outputs`](./cocktail/vodka_outputs.html) | ||
pub const outputs_with_policy = vodka_outputs.outputs_with_policy | ||
|
||
/// Documentation please refer to [`vodka_outputs`](./cocktail/vodka_outputs.html) | ||
pub const outputs_at_with = vodka_outputs.outputs_at_with | ||
|
||
/// Documentation please refer to [`vodka_outputs`](./cocktail/vodka_outputs.html) | ||
pub const outputs_at_with_policy = vodka_outputs.outputs_at_with_policy | ||
|
||
// Redeemers | ||
|
||
/// Documentation please refer to [`vodka_redeemers`](./cocktail/vodka_redeemers.html) | ||
pub const redeemer_from = vodka_redeemers.redeemer_from | ||
|
||
/// Documentation please refer to [`vodka_redeemers`](./cocktail/vodka_redeemers.html) | ||
pub const withdrawal_redeemer = vodka_redeemers.withdrawal_redeemer | ||
|
||
/// Documentation please refer to [`vodka_redeemers`](./cocktail/vodka_redeemers.html) | ||
pub const compare_output_reference = vodka_redeemers.compare_output_reference | ||
|
||
// Validity Range | ||
|
||
/// Documentation please refer to [`vodka_validity_range`](./cocktail/vodka_validity_range.html) | ||
pub const valid_after = vodka_validity_range.valid_after | ||
|
||
/// Documentation please refer to [`vodka_validity_range`](./cocktail/vodka_validity_range.html) | ||
pub const valid_before = vodka_validity_range.valid_before | ||
|
||
// Value | ||
|
||
/// Documentation please refer to [`vodka_value`](./cocktail/vodka_value.html) | ||
pub const value_length = vodka_value.value_length | ||
|
||
/// Documentation please refer to [`vodka_value`](./cocktail/vodka_value.html) | ||
pub const get_all_value_to = vodka_value.get_all_value_to | ||
|
||
/// Documentation please refer to [`vodka_value`](./cocktail/vodka_value.html) | ||
pub const get_all_value_from = vodka_value.get_all_value_from | ||
|
||
/// Documentation please refer to [`vodka_value`](./cocktail/vodka_value.html) | ||
pub const value_geq = vodka_value.value_geq | ||
|
||
/// Documentation please refer to [`vodka_value`](./cocktail/vodka_value.html) | ||
pub const value_policy_info = vodka_value.value_policy_info | ||
|
||
/// Documentation please refer to [`vodka_value`](./cocktail/vodka_value.html) | ||
pub const value_tokens = vodka_value.value_tokens |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.