ManifestBuilder

Struct ManifestBuilder 

Source
pub struct ManifestBuilder<M = TransactionManifestV1>{ /* private fields */ }
Expand description

A manifest builder for use in tests.

Note - if you break invariants of the manifest builder (e.g. resolve a bucket before it’s been created, or pass an invalid parameter), this builder will panic. As such, it’s only designed for use in test code, or where the inputs are trusted.

Simple use case:

let manifest = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    .take_from_worktop(XRD, dec!(1), "xrd")
    .try_deposit_or_abort(to_account_address, None, "xrd")
    .build();

Intermediate use case, where we need to pass a bucket into a component:

let manifest = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    .take_from_worktop(XRD, dec!(1), "xrd")
    .call_function_with_name_lookup(
        package_address,
        "SomeBlueprint",
        "some_function",
        |lookup| (
            lookup.bucket("xrd"),
        ),
    )
    .build();

Advanced use case, where we need to generate a collision-free bucket name:

let mut builder = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .get_free_xrd_from_faucet();
for _ in 0..32 {
    // The generate_bucket_name method generates a new bucket name starting with
    // "transfer" that doesn't collide with any previously used bucket names
    let bucket_name = builder.generate_bucket_name("transfer");
    builder = builder
        .take_from_worktop(XRD, "0.001", &bucket_name)
        .try_deposit_or_abort(to_account_address, None, bucket_name);
}
let manifest = builder.build();

Implementations§

Source§

impl ManifestBuilder

Source

pub fn new() -> ManifestBuilder

To create a Manifest Builder of a specific version, you may wish to use a specific new method such as new_v1(), new_v2() or new_system_v1().

For backwards compatibility, we had to keep ManifestBuilder::new() creating a [ManifestV1Builder].

Source

pub fn new_v1() -> ManifestBuilder

This exists so that you can call ManifestBuilder::new_v1(). It is equivalent to:

  • ManifestBuilder::<TransactionManifestV1>::new_typed()
  • TransactionManifestV1Builder::new_typed()
Source§

impl ManifestBuilder<TransactionManifestV2>

Source

pub fn new_v2() -> ManifestBuilder<TransactionManifestV2>

This exists so that you can call ManifestBuilder::new_v2(). It is equivalent to:

  • ManifestBuilder::<TransactionManifestV2>::new_typed()
  • ManifestV2Builder::new_typed()

For backwards compatibility, we had to keep ManifestBuilder::new() creating a [ManifestV1Builder].

Source§

impl ManifestBuilder<SubintentManifestV2>

Source

pub fn new_subintent_v2() -> ManifestBuilder<SubintentManifestV2>

This exists so that you can call ManifestBuilder::new_subintent_v2(). It is equivalent to:

  • ManifestBuilder::<SubintentManifestV2>::new_typed()
  • SubintentManifestV2Builder::new_typed()

For backwards compatibility, we had to keep ManifestBuilder::new() creating a [ManifestV1Builder].

Source§

impl ManifestBuilder<SystemTransactionManifestV1>

Source

pub fn new_system_v1() -> ManifestBuilder<SystemTransactionManifestV1>

This exists so that you can call ManifestBuilder::new_system_v1(). It is equivalent to:

  • ManifestBuilder::<SystemTransactionManifestV1>::new_typed()
  • SystemV1ManifestBuilder::new_typed()
Source

pub fn use_preallocated_address( &mut self, fixed_address: impl Into<GlobalAddress>, package_address: impl Into<PackageAddress>, blueprint_name: impl Into<String>, ) -> ManifestAddressReservation

Source§

impl<M> ManifestBuilder<M>

Source

pub fn preallocate_address( self, reservation: impl NewManifestAddressReservation, fixed_address: impl Into<GlobalAddress>, package_address: impl Into<PackageAddress>, blueprint_name: impl Into<String>, ) -> ManifestBuilder<M>

Source

pub fn preallocate_address_internal( &mut self, reservation: impl NewManifestAddressReservation, fixed_address: impl Into<GlobalAddress>, package_address: impl Into<PackageAddress>, blueprint_name: impl Into<String>, )

Source§

impl<M> ManifestBuilder<M>

Source

pub fn new_typed() -> ManifestBuilder<M>

Source

pub fn name_lookup(&self) -> ManifestNameLookup

Source

pub fn then( self, next: impl FnOnce(ManifestBuilder<M>) -> ManifestBuilder<M>, ) -> ManifestBuilder<M>

Source

pub fn with_name_lookup( self, next: impl FnOnce(ManifestBuilder<M>, ManifestNameLookup) -> ManifestBuilder<M>, ) -> ManifestBuilder<M>

Source

pub fn with_bucket( self, bucket: impl LabelledResolve<ManifestBucket>, next: impl FnOnce(ManifestBuilder<M>, ManifestBucket) -> ManifestBuilder<M>, ) -> ManifestBuilder<M>

Source

pub fn bucket(&self, name: impl AsRef<str>) -> ManifestBucket

Source

pub fn proof(&self, name: impl AsRef<str>) -> ManifestProof

Source

pub fn named_address(&self, name: impl AsRef<str>) -> ManifestNamedAddress

Source

pub fn address(&self, name: impl AsRef<str>) -> ManifestAddress

Source

pub fn address_reservation( &self, name: impl AsRef<str>, ) -> ManifestAddressReservation

Source

pub fn generate_bucket_name(&self, prefix: impl Into<String>) -> String

Generates an unused bucket name with the given prefix. This should be used when you are programmatically generating buckets, and need to generate bucket names which do not clash.

Source

pub fn generate_proof_name(&self, prefix: impl Into<String>) -> String

Generates an unused proof name with the given prefix. This should be used when you are programmatically generating proofs, and need to generate names which do not clash.

Source

pub fn generate_address_reservation_name( &self, prefix: impl Into<String>, ) -> String

Generates an unused address reservation name with the given prefix. This should be used when you are programmatically generating address reservations, and need to generate names which do not clash.

Source

pub fn generate_address_name(&self, prefix: impl Into<String>) -> String

Generates an unused address name with the given prefix. This should be used when you are programmatically generating named addresses, and need to generate names which do not clash.

Source

pub fn object_names(&self) -> KnownManifestObjectNames

Source

pub fn add_blob(&mut self, blob_content: Vec<u8>) -> ManifestBlobRef

Example usage:


let manifest = ManifestBuilder::new()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    // ...
    .then(|mut builder| {
        let code_blob_ref = builder.add_blob(vec![]);
        builder
            .call_function(
                package_address,
                "my_blueprint",
                "func_name",
                manifest_args!(code_blob_ref),
            )
    })
    .build();
Source

pub fn add_instruction_advanced( self, instruction: impl Into<<M as TypedReadableManifest>::Instruction>, ) -> (ManifestBuilder<M>, NewSymbols)

Only for use in advanced use cases. Returns all the created symbols as part of the instruction.

Source

pub fn build(self) -> M

Validates the built manifest with the tightest rules, and returns the manifest. If you don’t wish to validate the manifest, use build_no_validate instead.

Source

pub fn build_no_validate(self) -> M

Returns the built transaction manifest, without further validation. If you also wish to validate the manifest, use build instead.

Source§

impl<M> ManifestBuilder<M>

Source

pub fn take_all_from_worktop( self, resource_address: impl ResolvableStaticManifestResourceAddress, new_bucket: impl NewManifestBucket, ) -> ManifestBuilder<M>

Takes resource from worktop.

Source

pub fn take_from_worktop( self, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, new_bucket: impl NewManifestBucket, ) -> ManifestBuilder<M>

Takes resource from worktop, by amount.

Source

pub fn take_non_fungibles_from_worktop( self, resource_address: impl ResolvableStaticManifestResourceAddress, ids: impl IntoIterator<Item = NonFungibleLocalId>, new_bucket: impl NewManifestBucket, ) -> ManifestBuilder<M>

Takes resource from worktop, by non-fungible ids.

Source

pub fn return_to_worktop( self, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Adds a bucket of resource to worktop.

Source

pub fn assert_worktop_contains( self, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Asserts that worktop contains resource.

Source

pub fn assert_worktop_contains_any( self, resource_address: impl ResolvableStaticManifestResourceAddress, ) -> ManifestBuilder<M>

Asserts that worktop contains resource.

Source

pub fn assert_worktop_contains_non_fungibles( self, resource_address: impl ResolvableStaticManifestResourceAddress, ids: impl IntoIterator<Item = NonFungibleLocalId>, ) -> ManifestBuilder<M>

Asserts that worktop contains resource.

Source

pub fn pop_from_auth_zone( self, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Pops the most recent proof from auth zone.

Source

pub fn push_to_auth_zone( self, proof: impl ConsumedManifestProof, ) -> ManifestBuilder<M>

Pushes a proof onto the auth zone

Source

pub fn create_proof_from_auth_zone_of_amount( self, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Creates proof from the auth zone by amount.

Source

pub fn create_proof_from_auth_zone_of_non_fungibles( self, resource_address: impl ResolvableStaticManifestResourceAddress, ids: impl IntoIterator<Item = NonFungibleLocalId>, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Creates proof from the auth zone by non-fungible ids.

Source

pub fn create_proof_from_auth_zone_of_all( self, resource_address: impl ResolvableStaticManifestResourceAddress, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Creates proof from the auth zone

Source

pub fn create_proof_from_bucket_of_amount( self, bucket: impl ReferencedManifestBucket, amount: impl Resolve<Decimal>, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Creates proof from a bucket. The bucket is not consumed by this process.

Source

pub fn create_proof_from_bucket_of_non_fungibles( self, bucket: impl ReferencedManifestBucket, ids: impl IntoIterator<Item = NonFungibleLocalId>, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Creates proof from a bucket. The bucket is not consumed by this process.

Source

pub fn create_proof_from_bucket_of_all( self, bucket: impl ReferencedManifestBucket, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Creates proof from a bucket. The bucket is not consumed by this process.

Source

pub fn clone_proof( self, proof: impl ReferencedManifestProof, new_proof: impl NewManifestProof, ) -> ManifestBuilder<M>

Clones a proof.

Source

pub fn allocate_global_address( self, package_address: impl ResolvableStaticManifestPackageAddress, blueprint_name: impl Into<String>, new_address_reservation: impl NewManifestAddressReservation, new_address_name: impl NewNamedManifestAddress, ) -> ManifestBuilder<M>

Source

pub fn drop_proof(self, proof: impl ConsumedManifestProof) -> ManifestBuilder<M>

Drops a proof.

Source

pub fn drop_all_proofs(self) -> ManifestBuilder<M>

Drops all proofs.

Source

pub fn drop_named_proofs(self) -> ManifestBuilder<M>

Drops named proofs.

Source

pub fn drop_auth_zone_signature_proofs(self) -> ManifestBuilder<M>

Drops auth zone signature proofs.

Source

pub fn drop_auth_zone_regular_proofs(self) -> ManifestBuilder<M>

Drops auth zone regular proofs.

Source

pub fn drop_auth_zone_proofs(self) -> ManifestBuilder<M>

Drop auth zone proofs.

Source

pub fn create_fungible_resource( self, owner_role: OwnerRole, track_total_supply: bool, divisibility: u8, resource_roles: FungibleResourceRoles, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, initial_supply: Option<Decimal>, ) -> ManifestBuilder<M>

Creates a fungible resource

Source

pub fn create_non_fungible_resource<T, V>( self, owner_role: OwnerRole, id_type: NonFungibleIdType, track_total_supply: bool, resource_roles: NonFungibleResourceRoles, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, initial_supply: Option<T>, ) -> ManifestBuilder<M>

Creates a new non-fungible resource

Source

pub fn create_ruid_non_fungible_resource<T, V>( self, owner_role: OwnerRole, track_total_supply: bool, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, resource_roles: NonFungibleResourceRoles, initial_supply: Option<T>, ) -> ManifestBuilder<M>
where T: IntoIterator<Item = V>, V: ManifestEncode + NonFungibleData,

Source

pub fn update_non_fungible_data( self, resource_address: impl ReferencedManifestResourceAddress, id: NonFungibleLocalId, field_name: impl Into<String>, data: impl ManifestEncode, ) -> ManifestBuilder<M>

Source

pub fn create_identity_advanced( self, owner_role: OwnerRole, ) -> ManifestBuilder<M>

Source

pub fn create_identity(self) -> ManifestBuilder<M>

Source

pub fn create_validator( self, key: Secp256k1PublicKey, fee_factor: impl Resolve<Decimal>, xrd_payment: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn register_validator( self, validator_address: impl ReferencedManifestComponentAddress, ) -> ManifestBuilder<M>

Source

pub fn unregister_validator( self, validator_address: impl ReferencedManifestComponentAddress, ) -> ManifestBuilder<M>

Source

pub fn signal_protocol_update_readiness( self, validator_address: impl ReferencedManifestComponentAddress, protocol_version_name: &str, ) -> ManifestBuilder<M>

Source

pub fn stake_validator_as_owner( self, validator_address: impl ReferencedManifestComponentAddress, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn stake_validator( self, validator_address: impl ReferencedManifestComponentAddress, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn unstake_validator( self, validator_address: impl ReferencedManifestComponentAddress, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn claim_xrd( self, validator_address: impl ReferencedManifestComponentAddress, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn call_function( self, package_address: impl ReferencedManifestPackageAddress, blueprint_name: impl Into<String>, function_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Calls a scrypto function where the arguments should be one of:

  • A tuple, such as (), (x,) or (x, y, z)
    • IMPORTANT: If calling with a single argument, you must include a trailing comma in the tuple declaration. This ensures that the rust compiler knows it’s a singleton tuple, rather than just some brackets around the inner value.
  • A struct which implements ManifestEncode representing the arguments
  • manifest_args!(x, y, z)

NOTE: If you need access to named buckets/proofs etc, use then or call_function_with_name_lookup instead.

Source

pub fn call_function_raw( self, package_address: impl ReferencedManifestPackageAddress, blueprint_name: impl Into<String>, function_name: impl Into<String>, arguments: Value<ManifestCustomValueKind, ManifestCustomValue>, ) -> ManifestBuilder<M>

Calls a scrypto function where the arguments are a raw ManifestValue. The caller is required to ensure the ManifestValue is a Tuple.

You should prefer call_function or call_function_with_name_lookup instead.

Source

pub fn call_function_with_name_lookup<T>( self, package_address: impl ReferencedManifestPackageAddress, blueprint_name: impl Into<String>, function_name: impl Into<String>, arguments_creator: impl FnOnce(&ManifestNameLookup) -> T, ) -> ManifestBuilder<M>

Calls a scrypto function where the arguments will be created using the given callback, which takes a lookup (allowing for resolving named buckets, proofs, etc) and returns resolvable arguments.

You may prefer using then instead.

The resolvable arguments should be one of:

  • A tuple, such as (), (x,) or (x, y, z)
    • IMPORTANT: If calling with a single argument, you must include a trailing comma in the tuple declaration. This ensures that the rust compiler knows it’s a singleton tuple, rather than just some brackets around the inner value.
  • A struct which implements ManifestEncode representing the arguments
  • manifest_args!(x, y, z)

Example:

let manifest = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    .take_from_worktop(XRD, dec!(1), "xrd_bucket")
    .call_function_with_name_lookup(
        package_address,
        "SomeBlueprint",
        "some_function",
        |lookup| (
            "argument1",
            lookup.bucket("xrd_bucket"),
            dec!("1.3")
        ),
    )
    .build();

// Alternative using `then`
let manifest2 = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    .take_from_worktop(XRD, dec!(1), "xrd_bucket")
    .then(|builder| {
        let lookup = builder.name_lookup();
        builder.call_function(
            package_address,
            "SomeBlueprint",
            "some_function",
            ("argument1", lookup.bucket("xrd_bucket"), dec!("1.3")),
        )
    })
    .build();
Source

pub fn call_method( self, address: impl ReferencedManifestGlobalAddress, method_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Calls a scrypto method where the arguments should be one of:

  • A tuple, such as (), (x,) or (x, y, z)
    • IMPORTANT: If calling with a single argument, you must include a trailing comma in the tuple declaration. This ensures that the rust compiler knows it’s a singleton tuple, rather than just some brackets around the inner value.
  • A struct which implements ManifestEncode representing the arguments
  • manifest_args!(x, y, z)

NOTE: If you need access to named buckets/proofs etc, use call_method_with_name_lookup instead.

Source

pub fn call_metadata_method( self, address: impl ReferencedManifestGlobalAddress, method_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn call_royalty_method( self, address: impl ReferencedManifestGlobalAddress, method_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn call_direct_access_method( self, address: InternalAddress, method_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn set_owner_role( self, address: impl ReferencedManifestGlobalAddress, rule: impl Into<AccessRule>, ) -> ManifestBuilder<M>

Source

pub fn lock_owner_role( self, address: impl ReferencedManifestGlobalAddress, ) -> ManifestBuilder<M>

Source

pub fn set_main_role( self, address: impl ReferencedManifestGlobalAddress, role_key: impl Into<RoleKey>, rule: impl Into<AccessRule>, ) -> ManifestBuilder<M>

Source

pub fn set_role( self, address: impl ReferencedManifestGlobalAddress, role_module: ModuleId, role_key: impl Into<RoleKey>, rule: impl Into<AccessRule>, ) -> ManifestBuilder<M>

Source

pub fn get_role( self, address: impl ReferencedManifestGlobalAddress, role_module: ModuleId, role_key: RoleKey, ) -> ManifestBuilder<M>

Source

pub fn call_role_assignment_method( self, address: impl ReferencedManifestGlobalAddress, method_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn call_module_method( self, address: impl ReferencedManifestGlobalAddress, module_id: ModuleId, method_name: impl Into<String>, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn call_method_raw( self, address: impl ReferencedManifestGlobalAddress, method_name: impl Into<String>, arguments: Value<ManifestCustomValueKind, ManifestCustomValue>, ) -> ManifestBuilder<M>

Calls a scrypto method where the arguments are a raw ManifestValue. The caller is required to ensure the ManifestValue is a Tuple.

You should prefer call_function or call_function_with_name_lookup instead.

Source

pub fn call_method_with_name_lookup<T>( self, address: impl ReferencedManifestGlobalAddress, method_name: impl Into<String>, arguments_creator: impl FnOnce(&ManifestNameLookup) -> T, ) -> ManifestBuilder<M>

Calls a scrypto method where the arguments will be created using the given callback, which takes a lookup (allowing for resolving named buckets, proofs, etc) and returns resolvable arguments.

The resolvable arguments should be one of:

  • A tuple, such as (), (x,) or (x, y, z)
    • IMPORTANT: If calling with a single argument, you must include a trailing comma in the tuple declaration. This ensures that the rust compiler knows it’s a singleton tuple, rather than just some brackets around the inner value.
  • A struct which implements ManifestEncode representing the arguments
  • manifest_args!(x, y, z)

Example:

let manifest = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    .take_from_worktop(XRD, dec!(1), "xrd_bucket")
    .call_method_with_name_lookup(
        component_address,
        "some_method",
        |lookup| (
            "argument1",
            lookup.bucket("xrd_bucket"),
            dec!("1.3")
        ),
    )
    .build();

// Alternative using `then`
let manifest2 = ManifestBuilder::new()
    .lock_fee_from_faucet()
    .withdraw_from_account(from_account_address, XRD, dec!(1))
    .take_from_worktop(XRD, dec!(1), "xrd_bucket")
    .then(|builder| {
        let lookup = builder.name_lookup();
        builder.call_method(
            component_address,
            "some_method",
            ("argument1", lookup.bucket("xrd_bucket"), dec!("1.3")),
        )
    })
    .build();
Source

pub fn claim_package_royalties( self, package_address: impl ReferencedManifestPackageAddress, ) -> ManifestBuilder<M>

Source

pub fn set_component_royalty( self, component_address: impl ReferencedManifestComponentAddress, method: impl Into<String>, amount: RoyaltyAmount, ) -> ManifestBuilder<M>

Source

pub fn lock_component_royalty( self, component_address: impl ReferencedManifestComponentAddress, method: impl Into<String>, ) -> ManifestBuilder<M>

Source

pub fn claim_component_royalties( self, component_address: impl ReferencedManifestComponentAddress, ) -> ManifestBuilder<M>

Source

pub fn set_metadata( self, address: impl ReferencedManifestGlobalAddress, key: impl Into<String>, value: impl ToMetadataEntry, ) -> ManifestBuilder<M>

Source

pub fn lock_metadata( self, address: impl ReferencedManifestGlobalAddress, key: impl Into<String>, ) -> ManifestBuilder<M>

Source

pub fn freeze_metadata( self, address: impl ReferencedManifestGlobalAddress, key: impl Into<String>, ) -> ManifestBuilder<M>

Source

pub fn publish_package_advanced( self, address_reservation: impl ConsumedOptionalManifestAddressReservation, code: Vec<u8>, definition: PackageDefinition, metadata: impl Into<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, owner_role: OwnerRole, ) -> ManifestBuilder<M>

Publishes a package.

Source

pub fn publish_package( self, code: Vec<u8>, definition: PackageDefinition, ) -> ManifestBuilder<M>

Publishes a package with an owner badge.

Source

pub fn publish_package_with_owner( self, code: Vec<u8>, definition: PackageDefinition, owner_badge: NonFungibleGlobalId, ) -> ManifestBuilder<M>

Publishes a package with an owner badge.

Source

pub fn new_token_mutable( self, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, owner_role: AccessRule, ) -> ManifestBuilder<M>

Creates a token resource with mutable supply.

Source

pub fn new_token_fixed( self, owner_role: OwnerRole, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, initial_supply: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Creates a token resource with fixed supply.

Source

pub fn new_badge_mutable( self, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, owner_role: AccessRule, ) -> ManifestBuilder<M>

Creates a badge resource with mutable supply.

Source

pub fn new_badge_fixed( self, owner_role: OwnerRole, metadata: ModuleConfig<KeyValueStoreInit<String, GenericMetadataValue<UncheckedUrl, UncheckedOrigin>>>, initial_supply: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Creates a badge resource with fixed supply.

Source

pub fn burn_resource( self, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn burn_from_worktop( self, amount: impl Resolve<Decimal>, resource_address: impl ResolvableStaticManifestResourceAddress, ) -> ManifestBuilder<M>

Source

pub fn burn_all_from_worktop( self, resource_address: impl ResolvableStaticManifestResourceAddress, ) -> ManifestBuilder<M>

Source

pub fn burn_non_fungible_from_worktop( self, non_fungible_global_id: NonFungibleGlobalId, ) -> ManifestBuilder<M>

Source

pub fn mint_fungible( self, resource_address: impl ReferencedManifestResourceAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Source

pub fn mint_non_fungible<T, V>( self, resource_address: impl ReferencedManifestResourceAddress, entries: T, ) -> ManifestBuilder<M>

Source

pub fn mint_ruid_non_fungible<T, V>( self, resource_address: impl ReferencedManifestResourceAddress, entries: T, ) -> ManifestBuilder<M>
where T: IntoIterator<Item = V>, V: ManifestEncode,

Source

pub fn recall( self, vault_address: InternalAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Source

pub fn recall_non_fungibles( self, vault_address: InternalAddress, non_fungible_local_ids: impl IntoIterator<Item = NonFungibleLocalId>, ) -> ManifestBuilder<M>

Source

pub fn freeze_withdraw(self, vault_id: InternalAddress) -> ManifestBuilder<M>

Source

pub fn unfreeze_withdraw(self, vault_id: InternalAddress) -> ManifestBuilder<M>

Source

pub fn freeze_deposit(self, vault_id: InternalAddress) -> ManifestBuilder<M>

Source

pub fn unfreeze_deposit(self, vault_id: InternalAddress) -> ManifestBuilder<M>

Source

pub fn freeze_burn(self, vault_id: InternalAddress) -> ManifestBuilder<M>

Source

pub fn unfreeze_burn(self, vault_id: InternalAddress) -> ManifestBuilder<M>

Source

pub fn new_account_advanced( self, owner_role: OwnerRole, address_reservation: impl ConsumedOptionalManifestAddressReservation, ) -> ManifestBuilder<M>

Creates an account.

Source

pub fn new_account(self) -> ManifestBuilder<M>

Source

pub fn lock_fee_and_withdraw( self, account_address: impl ReferencedManifestComponentAddress, amount_to_lock: impl Resolve<Decimal>, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Source

pub fn lock_fee_and_withdraw_non_fungibles( self, account_address: impl ReferencedManifestComponentAddress, amount_to_lock: impl Resolve<Decimal>, resource_address: impl ResolvableStaticManifestResourceAddress, ids: impl IntoIterator<Item = NonFungibleLocalId>, ) -> ManifestBuilder<M>

Source

pub fn lock_fee_from_faucet(self) -> ManifestBuilder<M>

Locks a large fee from the faucet.

Source

pub fn lock_standard_test_fee( self, account_address: impl ReferencedManifestComponentAddress, ) -> ManifestBuilder<M>

Locks a large fee from the XRD vault of an account.

Source

pub fn lock_fee( self, account_address: impl ReferencedManifestComponentAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Locks a fee from the XRD vault of an account.

Source

pub fn lock_contingent_fee( self, account_address: impl ReferencedManifestComponentAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Source

pub fn get_free_xrd_from_faucet(self) -> ManifestBuilder<M>

Locks a large fee from the faucet.

Source

pub fn withdraw_from_account( self, account_address: impl ReferencedManifestComponentAddress, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Withdraws resource from an account.

Source

pub fn withdraw_non_fungible_from_account( self, account_address: impl ReferencedManifestComponentAddress, non_fungible_global_id: NonFungibleGlobalId, ) -> ManifestBuilder<M>

Withdraws a single non-fungible from an account.

Source

pub fn withdraw_non_fungibles_from_account( self, account_address: impl ReferencedManifestComponentAddress, resource_address: impl ResolvableStaticManifestResourceAddress, ids: impl IntoIterator<Item = NonFungibleLocalId>, ) -> ManifestBuilder<M>

Withdraws non-fungibles from an account.

Source

pub fn burn_in_account( self, account_address: impl ReferencedManifestComponentAddress, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Withdraws resource from an account.

Source

pub fn burn_non_fungible_in_account( self, account_address: impl ReferencedManifestComponentAddress, non_fungible_global_id: NonFungibleGlobalId, ) -> ManifestBuilder<M>

Burns a single non-fungible from an account.

Source

pub fn burn_non_fungibles_in_account( self, account_address: impl ReferencedManifestComponentAddress, resource_address: impl ResolvableStaticManifestResourceAddress, local_ids: impl IntoIterator<Item = NonFungibleLocalId>, ) -> ManifestBuilder<M>

Burns non-fungibles from an account.

Source

pub fn create_proof_from_account_of_amount( self, account_address: impl ReferencedManifestComponentAddress, resource_address: impl ResolvableStaticManifestResourceAddress, amount: impl Resolve<Decimal>, ) -> ManifestBuilder<M>

Creates resource proof from an account.

Source

pub fn create_proof_from_account_of_non_fungible( self, account_address: impl ReferencedManifestComponentAddress, non_fungible_global_id: NonFungibleGlobalId, ) -> ManifestBuilder<M>

Creates resource proof from an account.

Source

pub fn create_proof_from_account_of_non_fungibles( self, account_address: impl ReferencedManifestComponentAddress, resource_address: impl ResolvableStaticManifestResourceAddress, local_ids: impl IntoIterator<Item = NonFungibleLocalId>, ) -> ManifestBuilder<M>

Creates resource proof from an account.

Source

pub fn deposit( self, account_address: impl ReferencedManifestComponentAddress, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn deposit_batch( self, account_address: impl ReferencedManifestComponentAddress, batch: impl ConsumedBucketBatch, ) -> ManifestBuilder<M>

Note - the batch should either be:

  • ManifestExpression::EntireWorktop,
  • An array, vec, or btreeset of bucket names or ManifestBuckets, eg ["my_bucket_1", "my_bucket_2"]
  • An empty, explicitly typed array of strings, eg Vec::<String>::new()
Source

pub fn deposit_entire_worktop( self, account_address: impl ReferencedManifestComponentAddress, ) -> ManifestBuilder<M>

Source

pub fn try_deposit_or_abort( self, account_address: impl ReferencedManifestComponentAddress, authorized_depositor_badge: Option<ResourceOrNonFungible>, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn try_deposit_batch_or_abort( self, account_address: impl ReferencedManifestComponentAddress, batch: impl ConsumedBucketBatch, authorized_depositor_badge: Option<ResourceOrNonFungible>, ) -> ManifestBuilder<M>

Note - the batch should either be:

  • ManifestExpression::EntireWorktop,
  • An array, vec, or btreeset of bucket names or ManifestBuckets, eg ["my_bucket_1", "my_bucket_2"]
  • An empty, explicitly typed array of strings, eg Vec::<String>::new()
Source

pub fn try_deposit_entire_worktop_or_abort( self, account_address: impl ReferencedManifestComponentAddress, authorized_depositor_badge: Option<ResourceOrNonFungible>, ) -> ManifestBuilder<M>

Source

pub fn try_deposit_or_refund( self, account_address: impl ReferencedManifestComponentAddress, authorized_depositor_badge: Option<ResourceOrNonFungible>, bucket: impl ConsumedManifestBucket, ) -> ManifestBuilder<M>

Source

pub fn try_deposit_batch_or_refund( self, account_address: impl ReferencedManifestComponentAddress, batch: impl ConsumedBucketBatch, authorized_depositor_badge: Option<ResourceOrNonFungible>, ) -> ManifestBuilder<M>

Note - the batch should either be:

  • ManifestExpression::EntireWorktop,
  • An array, vec, or btreeset of bucket names or ManifestBuckets, eg ["my_bucket_1", "my_bucket_2"]
  • An empty, explicitly typed array of strings, eg Vec::<String>::new()
Source

pub fn try_deposit_entire_worktop_or_refund( self, account_address: impl ReferencedManifestComponentAddress, authorized_depositor_badge: Option<ResourceOrNonFungible>, ) -> ManifestBuilder<M>

Source

pub fn create_account_with_owner( self, address_reservation: impl ConsumedOptionalManifestAddressReservation, owner_role: OwnerRole, ) -> ManifestBuilder<M>

Source

pub fn create_access_controller( self, controlled_asset: impl ConsumedManifestBucket, primary_role: AccessRule, recovery_role: AccessRule, confirmation_role: AccessRule, timed_recovery_delay_in_minutes: Option<u32>, ) -> ManifestBuilder<M>

Source§

impl<M> ManifestBuilder<M>

Source§

impl<M> ManifestBuilder<M>

Source

pub fn use_child( self, child_name: impl NewManifestIntent, subintent_hash: SubintentHash, ) -> ManifestBuilder<M>

Source

pub fn yield_to_child( self, child_manifest_intent: impl ReferencedManifestIntent, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn yield_to_child_with_name_lookup<T>( self, child_manifest_intent: impl ReferencedManifestIntent, arguments_creator: impl FnOnce(&ManifestNameLookup) -> T, ) -> ManifestBuilder<M>

Source§

impl<M> ManifestBuilder<M>

Source

pub fn yield_to_parent( self, arguments: impl ResolvableArguments, ) -> ManifestBuilder<M>

Source

pub fn yield_to_parent_with_name_lookup<T>( self, arguments_creator: impl FnOnce(&ManifestNameLookup) -> T, ) -> ManifestBuilder<M>

Source

pub fn verify_parent(self, access_rule: AccessRule) -> ManifestBuilder<M>

Trait Implementations§

Source§

impl Default for ManifestBuilder

Source§

fn default() -> ManifestBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> ContextualTryInto<U> for T
where U: ContextualTryFrom<T>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromBits<T> for T

Source§

fn from_bits(other: T) -> T

Convert other to Self, preserving bitwise representation
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<X, Y> LabelledResolve<Y> for X
where Y: LabelledResolveFrom<X>,

Source§

fn labelled_resolve( self, resolver: &impl LabelResolver<<Y as LabelledResolvable>::ResolverOutput>, ) -> Y

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<X, Y> Resolve<Y> for X
where Y: ResolveFrom<X>,

Source§

fn resolve(self) -> Y

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.