-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(devx): Edit Developer > Stardust docs (#2063)
* feat(devx): edit stardust docs * feat(devx): archive stardust doc stubs * feat(devx): archive stardust doc stubs * feat(devx): add warning * fix(devx): fix sidebar after merge * feat(devx): change tabs groupId from code-language to language * Update docs/content/developer/stardust/claiming/self-sponsor.mdx Co-authored-by: Dr-Electron <[email protected]> --------- Co-authored-by: Dr-Electron <[email protected]>
- Loading branch information
1 parent
71713cb
commit a9e2da8
Showing
22 changed files
with
426 additions
and
264 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:::warning Exchanges and dApp Devs Only | ||
|
||
The migration documentation describes the processes needed to claim and migrate output types manually; However, for the average user, this knowledge is not needed and is abstracted in the wallet web application (dashboard). The specific migration knowledge described here is unnecessary for people using a regular wallet. | ||
|
||
::: |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
54 changes: 32 additions & 22 deletions
54
docs/content/developer/stardust/claiming/address-unlock-condition.mdx
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,66 +1,76 @@ | ||
--- | ||
title: Claiming an Output unlockable by an Alias/Nft Address | ||
description: A guide on how to claim Outputs Unlockable by an Alias/NFT Address in the Move-based IOTA ledger. | ||
--- | ||
import MigrationWarning from '../../../_snippets/migration-warning.mdx'; | ||
|
||
In Stardust outputs presented an Address Unlock Condition or similarly, in the case of the Alias Output, a [Governor Address Unlock Condition](https://github.com/iotaledger/tips/blob/main/tips/TIP-0018/tip-0018.md#governor-address-unlock-condition). In the new ledger, this mechanism is represented as an address owning the associated Output object. Most of the times the address is directly managed through a keypair by a user, but sometimes this address could represent another object. In this case, that object owns the interested Output object. Coming from the [Stardust migration](../migration-process.mdx#stardust-migration), only `Alias` and `Nft` objects can own other Output objects. | ||
# Claiming an Output Unlockable by an Alias/NFT Address | ||
|
||
## Claim of an Output owned by another Alias/Nft object | ||
<MigrationWarning/ > | ||
|
||
For this example, we're using an `AliasOutput` to extract an `Alias` object that owns an `NftOutput`. | ||
In Stardust, outputs had an Address Unlock Condition or, in the case of Alias Outputs, | ||
a [Governor Address Unlock Condition](https://github.com/iotaledger/tips/blob/main/tips/TIP-0018/tip-0018.md#governor-address-unlock-condition). | ||
In the new ledger, this mechanism is represented by an address owning the associated Output object. | ||
Most of the time, the address is directly managed by a user through a keypair. | ||
However, sometimes the address could represent another object. | ||
In this case, that object owns the associated Output object. | ||
After the [Stardust migration](../migration-process.mdx), only `Alias` and `Nft` objects can own other Output objects. | ||
|
||
1. The first step is to fetch the `AliasOutput` object that is needed for claiming the `NftOutput`. | ||
## Claiming an Output Owned by Another Alias/NFT Object | ||
|
||
<Tabs> | ||
<TabItem value="rs" label="Rust"> | ||
For this example, we use an `AliasOutput` to extract an `Alias` object that owns an `NftOutput`. | ||
|
||
1. The first step is to fetch the `AliasOutput` object that is needed to claim the `NftOutput`. | ||
|
||
<Tabs groupId="language"> | ||
<TabItem value="rust" label="Rust"> | ||
|
||
```rust file=<rootDir>/docs/examples/rust/stardust/address-unlock-condition.rs#L70-L88 | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="ts" label="TypeScript"> | ||
<TabItem value="typescript" label="TypeScript"> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
2. By using the dynamic field function with the "alias" dynamic field key filter, we gather the `Alias` object itself. | ||
2. Use the dynamic field function with the "alias" dynamic field key filter to gather the `Alias` object itself. | ||
|
||
<Tabs> | ||
<TabItem value="rs" label="Rust"> | ||
<Tabs groupId="language"> | ||
<TabItem value="rust" label="Rust"> | ||
|
||
```rust file=<rootDir>/docs/examples/rust/stardust/address-unlock-condition.rs#L90-L103 | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="ts" label="TypeScript"> | ||
<TabItem value="typescript" label="TypeScript"> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
3. Some objects are owned by the `Alias` object. In this case we filter them by type using the `NftOutput` type tag. | ||
Applying the filter to get `NftOutput`s owned by the `Alias`. | ||
3. Some objects are owned by the `Alias` object. In this case, filter them by type using the `NftOutput` type tag. Apply the filter to get `NftOutput`s owned by the `Alias`. | ||
|
||
<Tabs> | ||
<TabItem value="rs" label="Rust"> | ||
<Tabs groupId="language"> | ||
<TabItem value="rust" label="Rust"> | ||
|
||
```rust file=<rootDir>/docs/examples/rust/stardust/address-unlock-condition.rs#L105-L128 | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="ts" label="TypeScript"> | ||
<TabItem value="typescript" label="TypeScript"> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
4. Create PTB that firstly extracts the assets from the `AliasOutput` and then it uses the extracted `Alias` to "address unlock" the `NftOutput` using the funсtion `unlock_alias_address_owned_nft`. | ||
4. Create a PTB that first extracts the assets from the `AliasOutput`, and then uses the extracted `Alias` to "address unlock" the `NftOutput` using the function `unlock_alias_address_owned_nft`. | ||
|
||
<Tabs> | ||
<TabItem value="rs" label="Rust"> | ||
<Tabs groupId="language"> | ||
<TabItem value="rust" label="Rust"> | ||
|
||
```rust file=<rootDir>/docs/examples/rust/stardust/address-unlock-condition.rs#L130-L239 | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="ts" label="TypeScript"> | ||
<TabItem value="typescript" label="TypeScript"> | ||
|
||
</TabItem> | ||
</Tabs> | ||
</Tabs> |
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
Oops, something went wrong.