Skip to content

Commit

Permalink
MDX Extravaganza! (#457)
Browse files Browse the repository at this point in the history
* MDX review

* Smart Contract Internals

* Migrating from EVM

* Glossary

* Encyclopedia

* Build Applications

* Issuing Assets

* Basic Tutorials

* Getting Started

* assets nit

* Example Contracts

* How-To Guides

* Tokens

* Tools and SDKs

* Reference

* fix links

* Anchor Platform

* Horizon

* RPC

* bye bye overview

* fix link
  • Loading branch information
briwylde08 authored Apr 18, 2024
1 parent 89f0fe2 commit d096507
Show file tree
Hide file tree
Showing 70 changed files with 191 additions and 201 deletions.
2 changes: 0 additions & 2 deletions docs/building-apps/application-design-considerations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ With a custodial service, the service provider (an application such as a central

Many custodial services choose to use a single pooled Stellar account (called shared, omnibus, or [pooled accounts](../learn/encyclopedia/pooled-accounts-muxed-accounts-memos.mdx)) to handle transactions on behalf of their users instead of creating a new Stellar account for each user. To distinguish between individual users in a pooled account, we encourage the implementation of [muxed accounts](../learn/encyclopedia/pooled-accounts-muxed-accounts-memos.mdx#muxed-accounts).

Learn how to set up an application as a custodial service in this [tutorial].

### A mixture of non-custodial and custodial

Building an application with [multi-signature](../learn/encyclopedia/signatures-multisig.mdx) capabilities allows you to have a non-custodial service with account recovery. If the user loses their secret key, they can still sign transactions with other authorized signatures, granted the signature threshold is high enough.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Source: https://github.com/stellar/basic-payment-app/blob/main/src/lib/stellar/h
Our `walletStore` is used in a ton of places in our application, especially in the confirmation modal when asking a user to input their pincode. Read on to see how we've done that.

[accounts section]: ../../learn/fundamentals/stellar-data-structures/accounts.mdx
[non-custodial application]: ../application-design-considerations#non-custodial-service
[non-custodial application]: ../application-design-considerations.mdx#non-custodial-service
[`js-stellar-wallets` sdk]: https://github.com/stellar/js-stellar-wallets
[sponsored reserves]: ../../learn/encyclopedia/sponsored-reserves.mdx
[contacts list]: ./contacts-list
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function getSep6Info(domain) {

## Display interactive elements

Since many of the SEP-6 (and SEP-24) endpoints require authentication, we wait until our user is [authenticated with SEP-10](./sep10) before we display what kinds of transfers are available. When they have a valid authentication token, we can display some buttons the user can use to begin a transfer.
Since many of the SEP-6 (and SEP-24) endpoints require authentication, we wait until our user is [authenticated with SEP-10](./sep10.mdx) before we display what kinds of transfers are available. When they have a valid authentication token, we can display some buttons the user can use to begin a transfer.

The user can then initiate one of the transfer methods (in BasicPay, only deposits and withdraws are supported) by clicking the “Deposit” or “Withdraw” button underneath a supported asset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: "Setup for Anchored Assets"
sidebar_position: 10
---

An anchor is a Stellar-specific term for the on and off-ramps that connect the Stellar network to traditional financial rails, such as financial institutions or fintech companies. When a user deposits with an anchor, that anchor will credit their Stellar account with the equivalent amount of digital tokens. The user can then hold, transfer, or trade those tokens just like any other Stellar asset. When a user withdraws those tokens, the anchor redeems them for cash in hand or money in the bank. Read more about anchors in our [Anchor Documentation](https://developers.stellar.org/docs/anchoring-assets/overview).
An anchor is a Stellar-specific term for the on and off-ramps that connect the Stellar network to traditional financial rails, such as financial institutions or fintech companies. When a user deposits with an anchor, that anchor will credit their Stellar account with the equivalent amount of digital tokens. The user can then hold, transfer, or trade those tokens just like any other Stellar asset. When a user withdraws those tokens, the anchor redeems them for cash in hand or money in the bank. Read more about anchors in this [anchor section](../../../learn/encyclopedia/anchors.mdx).

When a customer downloads a wallet application that is connected to an anchor service, their Stellar account can either be created by the wallet application or the anchor service. In this example, the account has been created by the wallet application, BasicPay. Account creation strategies are described more in-depth [here](../../application-design-considerations#account-creation-strategies).
When a customer downloads a wallet application that is connected to an anchor service, their Stellar account can either be created by the wallet application or the anchor service. In this example, the account has been created by the wallet application, BasicPay. Account creation strategies are described more in-depth [here](../../application-design-considerations.mdx#account-creation-strategies).

In this example, we’ll use an anchor on Stellar’s Testnet to simulate a bank transfer into and out of the user’s wallet using [SEP-6: Deposit and Withdrawal API](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0006.md) and/or [SEP-24: Hosted Deposit and Withdrawal](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_position: 10

:::note

This tutorial walks through how to build an application with the [`js-stellar-sdk`], to build with the Wallet SDK, please follow the [Build a Wallet tutorial](../wallet/overview). To build with smart contracts, navigate to the [Smart Contracts section](../../smart-contracts/getting-started/setup.mdx).
This tutorial walks through how to build an application with the [`js-stellar-sdk`], to build with the Wallet SDK, please follow the [Build a Wallet tutorial](../wallet/overview.mdx). To build with smart contracts, navigate to the [Smart Contracts section](../../smart-contracts/getting-started/setup.mdx).

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The following additional features have been implemented:
4. The amount entered for the send/receive value.
- An optional memo field is available for text-only memos.

For now, we'll focus on regular payments, and we'll dig into the path payments in a [later section](./path-payment).
For now, we'll focus on regular payments, and we'll dig into the path payments in a [later section](./path-payment.mdx).

```html title="/src/routes/dashboard/send/+page.svelte"
<script>
Expand Down
2 changes: 1 addition & 1 deletion docs/building-apps/wallet/sep24.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var asset = info.currencies.firstWhere((it)=>it.code=='USDC').assetId;

:::info

Before starting with the deposit flow, make sure that the user account has [established a trustline](/docs/building-apps/wallet/stellar#modify-assets-trustlines) for the asset you are working with.
Before starting with the deposit flow, make sure that the user account has [established a trustline](/docs/building-apps/wallet/stellar.mdx#modify-assets-trustlines) for the asset you are working with.

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/building-apps/wallet/sep6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Header from "./component/header.mdx";

The [SEP-6] standard defines a way for anchors and wallets to interact on behalf of users. Wallets use this standard to facilitate exchanges between on-chain assets (such as stablecoins) and off-chain assets (such as fiat, or other network assets such as BTC).

Please note, this is for _programmatic_ deposits and withdrawals. For hosted deposits and withdrawals, where the anchor interacts with wallets interactively using a popup, please see [Hosted Deposit and Withdrawal](/docs/building-apps/wallet/sep24).
Please note, this is for _programmatic_ deposits and withdrawals. For hosted deposits and withdrawals, where the anchor interacts with wallets interactively using a popup, please see [Hosted Deposit and Withdrawal](/docs/building-apps/wallet/sep24.mdx).

## Get Anchor Information

Expand Down Expand Up @@ -44,7 +44,7 @@ To initiate an operation, we need to know an asset. You can hardcode this. Ensur

:::info

Before starting with the deposit flow, make sure that the user account has [established a trustline](/docs/building-apps/wallet/stellar#modify-assets-trustlines) for the asset you are working with.
Before starting with the deposit flow, make sure that the user account has [established a trustline](/docs/building-apps/wallet/stellar.mdx#modify-assets-trustlines) for the asset you are working with.

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/issuing-assets/anatomy-of-an-asset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ One major category of assets is the stablecoin. A stablecoin is a blockchain-bas

Reserve-backed stablecoins are pegged to a real-world asset at a 1:1 ratio. Because the underlying asset is maintained as collateral, users should be able to trade their stablecoin for the asset at any time. Asset reserves can be maintained by independent custodians and should be regularly audited.

Currently, one of Stellar's most significant use cases is the tokenization of fiat currency for processes like cross-border payments. With anchors, users can connect Stellar tokens to existing rails that allow for the deposit of real-world assets in exchange for digital currency and vice versa. Learn more about anchors in our [Anchors section](https://developers.stellar.org/docs/anchoring-assets/).
Currently, one of Stellar's most significant use cases is the tokenization of fiat currency for processes like cross-border payments. With anchors, users can connect Stellar tokens to existing rails that allow for the deposit of real-world assets in exchange for digital currency and vice versa. Learn more about anchors in our [Anchors section](../learn/encyclopedia/anchors.mdx).

### Treasury management

Expand All @@ -27,5 +27,5 @@ When issuing a reserve-backed stablecoin, you must set up its off-chain reserve,

As an asset issuer, you may need to comply with regulatory requirements that vary based on jurisdiction. Stellar has built-in features that can help meet these requirements, such as:

- [Controlling access to an asset with flags](./control-asset-access#controlling-access-to-an-asset-with-flags)
- [Controlling access to an asset with flags](./control-asset-access.mdx#controlling-access-to-an-asset-with-flags)
- [SEP-0008: Regulated Assets](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0008.md) - regulated assets are assets that require an issuer’s approval (or a delegated third party’s approval) on a per-transaction basis. Check out this Stellar Ecosystem Proposal to learn how to implement regulated assets into your use case.
4 changes: 2 additions & 2 deletions docs/learn/encyclopedia/claimable-balances.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Once a ClaimableBalanceEntry has been claimed, it is deleted.

### Create Claimable Balance

For basic parameters, see the Create Claimable Balance entry in our [List of Operations section](../fundamentals/list-of-operations#create-claimable-balance).
For basic parameters, see the Create Claimable Balance entry in our [List of Operations section](../fundamentals/list-of-operations.mdx#create-claimable-balance).

#### Additional parameters

Expand Down Expand Up @@ -53,7 +53,7 @@ This operation claws back a claimable balance, returning the asset to the issuer

Clawback claimable balances require the claimable balance ID.

Learn more about clawbacks in our [Clawback Encyclopedia Entry](./clawbacks).
Learn more about clawbacks in our [Clawback Encyclopedia Entry](./clawbacks.mdx).

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/encyclopedia/error-handling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ If you’re using SDF’s public Horizon instance, you may get a `429 Too Many R
Any transaction that would reduce an account’s balance to less than the minimum will be rejected with an `INSUFFICIENT_BALANCE` error. Likewise, lumen selling liabilities that would reduce an account’s balance to less than the minimum plus lumen selling liabilities will be rejected with an `INSUFFICIENT_BALANCE` error.
For more on minimum balances, see our [Lumens section](../fundamentals/lumens#minimum-balance).
For more on minimum balances, see our [Lumens section](../fundamentals/lumens.mdx#minimum-balance).
2 changes: 1 addition & 1 deletion docs/learn/encyclopedia/fee-bump-transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ A fee-bump transaction goes through a series of checks in its lifecycle to deter
- If the fee-bump transaction is taking advantage of the replace-by-fee, the fee must be 10x higher than the first transaction
- **Fee account signature** — the fee-bump transaction envelope must contain a valid signature for the fee account. Additionally, the weight of that signature must meet the low threshold for the fee account, and the appropriate network passphrase must be part of the transaction hash signed by the fee account.
- **Fee account balance** — the fee account must have a sufficient XLM balance to cover the fee
- **Inner transaction** — the inner transaction must be valid, which means it must meet the requirements described in the [Validity of a Transaction section](../fundamentals/stellar-data-structures/operations-and-transactions#transaction-and-operation-validity). If validation of the inner transaction is successful, then the result is `FEE_BUMP_INNER_SUCCESS`, and the validation results from the validation of the inner transaction appear in the inner result. If the inner transaction is invalid, the result is `FEE_BUMP_INNER_FAILED`, and the fee-bump transaction is invalid because the inner transaction is invalid.
- **Inner transaction** — the inner transaction must be valid, which means it must meet the requirements described in the [Validity of a Transaction section](../fundamentals/stellar-data-structures/operations-and-transactions.mdx#transaction-and-operation-validity). If validation of the inner transaction is successful, then the result is `FEE_BUMP_INNER_SUCCESS`, and the validation results from the validation of the inner transaction appear in the inner result. If the inner transaction is invalid, the result is `FEE_BUMP_INNER_FAILED`, and the fee-bump transaction is invalid because the inner transaction is invalid.

## Application

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This section is scoped specifically to liquidity regarding the AMM and SDEX buil

Users can trade and convert assets on the Stellar network with the use of path payments through Stellar’s decentralized exchange and liquidity pools.

In this section, we will talk about the SDEX and liquidity pools. To learn about how these work together to execute transactions, see our [Path Payments Encyclopedia Entry](./path-payments).
In this section, we will talk about the SDEX and liquidity pools. To learn about how these work together to execute transactions, see our [Path Payments Encyclopedia Entry](./path-payments.mdx).

## SDEX

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/encyclopedia/memos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Memos are an optional unstructured data field that can be used to embed any addi

They were previously used to differentiate between individual accounts in a pooled account- something we used muxed accounts for now.

For more information on muxed accounts, see our [Pooled Accounts - Muxed Accounts & Memos Encyclopedia Entry](./pooled-accounts-muxed-accounts-memos)
For more information on muxed accounts, see our [Pooled Accounts - Muxed Accounts & Memos Encyclopedia Entry](./pooled-accounts-muxed-accounts-memos.mdx)

Memos can be one of the following types:

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/encyclopedia/path-payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Account A sells XLM → [buy XLM / sell ETH → buy ETH / sell BTC → buy BTC /

It is possible for path payments to fail if there are no viable exchange paths.

For more information on the Stellar Decentralized Exchange and Liquidity Pools, see our [Liquidity on Stellar: SDEX and Liquidity Pools Encyclopedia Entry](./liquidity-on-stellar-sdex-liquidity-pools)
For more information on the Stellar Decentralized Exchange and Liquidity Pools, see our [Liquidity on Stellar: SDEX and Liquidity Pools Encyclopedia Entry](./liquidity-on-stellar-sdex-liquidity-pools.mdx)

## Operations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ There are also abstractions for constructing and managing both muxed and regular

Prior to the introduction of muxed accounts, products and services that relied on pooled accounts often used transaction memos to differentiate between users. Supporting muxed accounts is better in the long term, but for now you may want to support both memos and muxed accounts as all exchanges, anchors, and wallets may not support muxed accounts.

To learn about what other purposes memos can be used for, see our [Memos Encyclopedia Entry](./memos).
To learn about what other purposes memos can be used for, see our [Memos Encyclopedia Entry](./memos.mdx).

## Why are muxed accounts better in the long term?

Expand Down
4 changes: 2 additions & 2 deletions docs/learn/encyclopedia/signatures-multisig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Transaction signatures are created by signing the transaction object contents wi

### Thresholds

Each operation falls under a specific threshold category: low, medium, or high with a number level between 0-255 (to read more about this see our section on [Operations and Transactions](../fundamentals/stellar-data-structures/operations-and-transactions#operations)). This threshold determines what signature weight is needed to authorize an operation.
Each operation falls under a specific threshold category: low, medium, or high with a number level between 0-255 (to read more about this see our section on [Operations and Transactions](../fundamentals/stellar-data-structures/operations-and-transactions.mdx#operations)). This threshold determines what signature weight is needed to authorize an operation.

To view each operation’s threshold, see our [List of Operations section](../fundamentals/list-of-operations).
To view each operation’s threshold, see our [List of Operations section](../fundamentals/list-of-operations.mdx).

Accounts can set their own signature weight, threshold values, and additional signing keys with the Set Options operation. By default, all operation threshold levels are set to 0, and the master key is set to weight 1. For most cases, it is recommended to set thresholds such that `low <= medium <= high`.

Expand Down
10 changes: 5 additions & 5 deletions docs/learn/encyclopedia/sponsored-reserves.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Both the Begin Sponsoring Future Reserves and the End Sponsoring Future Reserves

Anything that increases the minimum balance can be sponsored (account creation, offers, trustlines, data entries, signers, claimable balances).

To learn about base reserves, see our section on [Lumens](../fundamentals/lumens#base-reserves).
To learn about base reserves, see our section on [Lumens](../fundamentals/lumens.mdx#base-reserves).

## Sponsored reserves operations

Expand All @@ -28,7 +28,7 @@ End Sponsoring Future Reserves ends the current is-sponsoring-future-reserves-fo

At the end of any transaction, there must be no ongoing is-sponsoring-future-reserves-for relationships, which is why these two operations must be used together in a single transaction.

View operation details in our [List of Operations section](../fundamentals/list-of-operations).
View operation details in our [List of Operations section](../fundamentals/list-of-operations.mdx).

### Revoke sponsorship

Expand All @@ -47,7 +47,7 @@ Operation logic
- Source account is not the beneficiary of a is-sponsoring-future-reserves-for relationship
- No-Op

View operation details in our [List of Operations section](../fundamentals/list-of-operations#begin-sponsoring-future-reserves).
View operation details in our [List of Operations section](../fundamentals/list-of-operations.mdx#begin-sponsoring-future-reserves).

## Effect on minimum balance

Expand All @@ -57,13 +57,13 @@ When account A is sponsoring future reserves for account B, any reserve requirem

When a sponsored entry or subentry is removed, `numSponsoring` is decreased on the sponsoring account and `numSponsored` is decreased on the sponsored account.

To learn more about minimum balance requirements, see our section on [Lumens](../fundamentals/lumens#minimum-balance).
To learn more about minimum balance requirements, see our section on [Lumens](../fundamentals/lumens.mdx#minimum-balance).

## Effect on claimable balances

All claimable balances are sponsored through built-in logic in the claimable balance operations. The account that creates the claimable balance pays the base reserve to get the claimable balance on the ledger. When the claimable balance is claimed by the claimant(s), the claimable balance is removed from the ledger, and the account that created it gets the base reserve back.

Read more about claimable balances in our [Claimable Balances Encyclopedia Entry](./claimable-balances).
Read more about claimable balances in our [Claimable Balances Encyclopedia Entry](./claimable-balances.mdx).

## Examples

Expand Down
Loading

0 comments on commit d096507

Please sign in to comment.