diff --git a/docs/build/iota-sdk/1.0.0/docs/how-tos/alias/create.mdx b/docs/build/iota-sdk/1.0.0/docs/how-tos/alias/create.mdx new file mode 100644 index 00000000000..0d61ad30d92 --- /dev/null +++ b/docs/build/iota-sdk/1.0.0/docs/how-tos/alias/create.mdx @@ -0,0 +1,126 @@ +--- +title: Create Alias Output +description: 'How to programmatically create an alias output' +image: /img/logo/iota_mark_light.png +keywords: + - how to + - create + - alias + - output + - nodejs + - python + - rust +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +The Alias Output is a specific implementation of a UTXO state machine. Alias ID, the unique identifier of an instance of the deployed state machine, is generated deterministically by the protocol and is not allowed to change in any future state transitions. + +Alias Output represents an alias account in the ledger with two control levels and a permanentAlias Address. The account owns other outputs that are locked under Alias Address. The account keeps track of state transitions (`State Index` counter), controlled foundries (`Foundry Counter`) and anchors the layer 2 state as metadata into the UTXO ledger. + +## Example Code + + + + +The following example will: + +1. Instantiate a [`Wallet`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/core/struct.Wallet.html), get Alice's `Account` which was + [created in the first guide](../accounts-and-addresses/create-account.mdx). +2. Create an alias output transaction by calling the [`Account.create_alias_output()`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.CreateAliasParams.html) function. + +
+ +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias/create.rs#L40 +``` + +
+ +3. Retry transaction until included [`Transaction`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.retry_transaction_until_included) that was sent. + +
+ +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias/create.rs#L43 +``` + +
+ +
+ + +The following example will: + +1. Instantiate a [`Wallet`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/core/struct.Wallet.html), get Alice's `Account` which was + [created in the first guide](../accounts-and-addresses/create-account.mdx) and [sync it](../accounts-and-addresses/check-balance.mdx). +2. Create an alias output transaction by calling the [`Account.prepareCreateAliasOutput()`](../../references/nodejs/classes/Account.md#preparecreatealiasoutput) function. + +
+ +```typescript reference + https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/how_tos/alias/create.ts#L53 +``` + +
+ +3. Retry transaction until included [`Transaction`](../../references/nodejs/classes/Account/#retrytransactionuntilincluded) that was sent. + +
+ +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/how_tos/alias/create.ts#L60 +``` + +
+ +
+ + +1. Instantiate a [`Wallet`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/core/struct.Wallet.html), get Alice's `Account` which was + [created in the first guide](../accounts-and-addresses/create-account.mdx) and [sync it](../accounts-and-addresses/check-balance.mdx). +2. Create an alias output transaction by calling the [`Account.prepareCreateAliasOutput()`](../../references/python/iota_sdk/wallet/account.md#prepare_create_alias_output) function. + +
+ +```python reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/how_tos/alias/create.py#L22 +``` + +
+ +
+
+ +### Full Example Code + + + + +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias_wallet/request_funds.rs +``` + + + + +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias/create.rs +``` + + + + +```python reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/how_tos/alias/create.py +``` + + + + +### Expected Output + +```plaintext +... +``` diff --git a/docs/build/iota-sdk/1.0.0/docs/how-tos/alias/destroy.mdx b/docs/build/iota-sdk/1.0.0/docs/how-tos/alias/destroy.mdx new file mode 100644 index 00000000000..66eba6ceee5 --- /dev/null +++ b/docs/build/iota-sdk/1.0.0/docs/how-tos/alias/destroy.mdx @@ -0,0 +1,124 @@ +--- +title: Destroy Alias Output +description: 'How to programmatically destroy an alias output' +image: /img/logo/iota_mark_light.png +keywords: + - how to + - destroy + - alias + - output + - nodejs + - python + - rust +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +You can destroy an alias output by ID. If the alias still owns any outputs when you try to destroy it, you will get an error. + +## Example Code + + + + +The following example will: + +1. Instantiate a [`Wallet`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/core/struct.Wallet.html), get Alice's `Account` which was + [created in the first guide](../accounts-and-addresses/create-account.mdx). +2. Destroy an alias output transaction by calling the [`Account.burn()`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.burn) function. + +
+ +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias/destroy.rs#L44 +``` + +
+ +3. Retry transaction until included [`Transaction`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/account/struct.Account.html#method.retry_transaction_until_included) that was sent. + +
+ +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias/destroy.rs#L47 +``` + +
+ +
+ + +The following example will: + +1. Instantiate a [`Wallet`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/core/struct.Wallet.html), get Alice's `Account` which was + [created in the first guide](../accounts-and-addresses/create-account.mdx) and [sync it](../accounts-and-addresses/check-balance.mdx). +2. Destroy an alias output transaction by calling the [`Account.preparedestroyalias()`](../../references/nodejs/classes/Account.md#preparedestroyalias) function. + +
+ +```typescript reference + https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/how_tos/alias/destroy.ts#L56 +``` + +
+ +3. Retry transaction until included [`Transaction`](../../references/nodejs/classes/Account/#retrytransactionuntilincluded) that was sent. + +
+ +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/examples/how_tos/alias/destroy.ts#L63 +``` + +
+ +
+ + +1. Instantiate a [`Wallet`](https://docs.rs/iota-sdk/latest/iota_sdk/wallet/core/struct.Wallet.html), get Alice's `Account` which was + [created in the first guide](../accounts-and-addresses/create-account.mdx) and [sync it](../accounts-and-addresses/check-balance.mdx). +2. Destroy an alias output transaction by calling the [`Account.prepare_destroy_alias()`](../../references/python/iota_sdk/wallet/account.md#prepare_destroy_alias) function. + +
+ +```python reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/how_tos/alias/destroy.py#L25 +``` + +
+ +
+
+ +### Full Example Code + + + + +```rust reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias_wallet/destroy.rs +``` + + + + +```typescript reference +https://github.com/iotaledger/iota-sdk/blob/develop/sdk/examples/how_tos/alias/destroy.rs +``` + + + + +```python reference +https://github.com/iotaledger/iota-sdk/blob/develop/bindings/python/examples/how_tos/alias/destroy.py +``` + + + + +### Expected Output + +```plaintext +... +``` diff --git a/docs/build/iota-sdk/1.0.0/sidebars.js b/docs/build/iota-sdk/1.0.0/sidebars.js index a5a11822263..0972a123011 100644 --- a/docs/build/iota-sdk/1.0.0/sidebars.js +++ b/docs/build/iota-sdk/1.0.0/sidebars.js @@ -155,6 +155,16 @@ module.exports = { }, ], }, + { + type: 'category', + label: 'Alias Outputs', + items: [ + { + type: 'autogenerated', + dirName: 'how-tos/alias', + }, + ], + }, { type: 'category', label: 'Advanced Transactions',