Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ order: 120
import { ExampleResponse } from "@site/src/components/ExampleResponse";
import { AttributeTable } from "@site/src/components/AttributeTable";

Set, modify, or delete a data entry (name/value pair) for an account.
For more information on how to set, modify, or delete a data entry (`name:value` pair) for an account, see the [`manageData` operation](../../../../../../../learn/fundamentals/transactions/list-of-operations.mdx#manage-data).

See the [`Manage Data` errors](../../../errors/result-codes/operation-specific/manage-data.mdx).

Expand Down
12 changes: 6 additions & 6 deletions docs/data/apis/rpc/api-reference/methods/getLedgerEntries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ The `getLedgerEntries` method returns the "values" (or "entries") for a given se

The source of truth should always be the XDR defined in the protocol. `LedgerKey`s are a union type defined in [Stellar-ledger-entries.x](https://github.com/stellar/stellar-xdr/blob/v22.0/Stellar-ledger-entries.x#L600). There are 10 different forms a ledger key can take:

1. **Account:** holistically defines a Stellar account, including its balance, signers, etc. (see [Accounts](../../../../../learn/fundamentals/stellar-data-structures/accounts.mdx))
2. **Trustline:** defines a balance line to a non-native asset issued on the network (see [`changeTrustOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#change-trust))
3. **Offer:** defines an offer made on the Stellar DEX (see [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx))
4. **Account Data:** defines key-value data entries attached to an account (see [`manageDataOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#manage-data))
5. **Claimable Balance:** defines a balance that may or may not actively be claimable (see [Claimable Balances](../../../../../build/guides/transactions/claimable-balances.mdx))
6. **Liquidity Pool:** defines the configuration of a native constant liquidity pool between two assets (see [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx))
1. **Account:** holistically defines a Stellar account, including its balance, signers, etc. (_see_ [Accounts](../../../../../learn/fundamentals/stellar-data-structures/accounts.mdx))
2. **Trustline:** defines a balance line to a non-native asset issued on the network (_see_ [`changeTrustOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#change-trust))
3. **Offer:** defines an offer made on the Stellar DEX (_see_ [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx))
4. **Account Data:** defines key-value data entries attached to an account (_see_ [`manageDataOp`](../../../../../learn/fundamentals/transactions/list-of-operations.mdx#manage-data))
5. **Claimable Balance:** defines a balance that may or may not actively be claimable (_see_ [Claimable Balances](../../../../../build/guides/transactions/claimable-balances.mdx))
6. **Liquidity Pool:** defines the configuration of a native constant liquidity pool between two assets (_see_ [Liquidity on Stellar](../../../../../learn/fundamentals/liquidity-on-stellar-sdex-liquidity-pools.mdx))
7. **Contract Data:** defines a piece of data being stored in a contract under a key
8. **Contract Code:** defines the Wasm bytecode of a contract
9. **Config Setting:** defines the currently active network configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_position: 10
title: Native Data
description: Associate information with a classic account.
---

You can manage data associated with [accounts](../../stellar-data-structures/accounts.mdx) using the [`ManageData` operation](../../transactions/list-of-operations.mdx#manage-data), no smart contract needed! The data entry uses up one account subentry, increasing base reserves. In exchange for this slight cost, you can retrieve an account with [user-defined](../../../../data/apis/horizon/api-reference/resources/operations/object/manage-data.mdx) key-value pairs.

Existing community projects use this field for [IPFS direction](https://docs.ipfs.tech/concepts/content-addressing/), verification attestations, and much more. The information shows up towards the end of a Horizon response for a base account URL:

```curl
"signers": [
{ ... }
],
"data": {
"ipns": "azUxcXppNXVxdTVka2l0MjdnYzc4a2RmcWpneGxxaW9mdnBtOXFiY2NrZGtzbzVodHUxcWVjYnl5azQwY3o=",
"your": "value"
},
"num_sponsoring": ...
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ title: Persisting Data
description: Store and access smart contract data.
---

<head>
<title>Store and access smart contract data.</title>
<meta charSet="utf-8" />
<meta property="og:title" content="Store and access smart contract data." />
<meta
property="og:description"
content="Store and access smart contract data."
/>
</head>

## Ledger entries

Contracts can access ledger entries of type `CONTRACT_DATA`. Host functions are provided to probe, read, write, and delete `CONTRACT_DATA` ledger entries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ title: State Archival
description: Smart contract state archival.
---

<head>
<title>Smart contract state archival.</title>
<meta charSet="utf-8" />
<meta property="og:title" content="Smart contract state archival." />
<meta
property="og:description"
content="Learn about how state archival works on the Soroban smart contract platform."
/>
</head>

Contract data is made up of three different types: `Persistent`, `Temporary`, and `Instance`. In a contract, these are accessed with `env.storage().persistent()`, `env.storage().temporary()`, and `env.storage().instance()` respectively; see the [`storage()` docs](https://docs.rs/soroban-sdk/latest/soroban_sdk/storage/struct.Storage.html).

Learn about choosing the right storage for your use case in this [How-To Guide](../../../../build/guides/storage/choosing-the-right-storage.mdx) and other state archival related guides [here](../../../../build/guides/archival).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Account data is stored in subentries, each of which increases an account’s min
- Trustlines (includes traditional assets and pool shares)
- Offers
- Additional signers
- Data entries (includes data made with the `manageData` operation, not smart contract ledger entries)
- Data entries (includes data made with the [`manageData` function](../contract-development/storage/manage-data.mdx), not smart contract ledger entries)

## Trustlines

Expand Down
4 changes: 3 additions & 1 deletion docs/learn/fundamentals/transactions/list-of-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,12 @@ Transfers the XLM balance of an account to another account and removes the sourc

## Manage data

Sets, modifies, or deletes a data entry (name/value pair) that is attached to an account
Sets, modifies, or deletes a persistent data entry (`name:value` string pair) that is attached to an account.

Learn more about entries and subentries: [Accounts section](../stellar-data-structures/accounts.mdx#subentries)

Learn more about ManageData's functionality: [Storage page](../contract-development/storage/manage-data.mdx)

**SDKs**: [JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.manageData) | [Java](https://github.com/lightsail-network/java-stellar-sdk/blob/master/src/main/java/org/stellar/sdk/operations/ManageDataOperation.java) | [Go](https://godoc.org/github.com/stellar/go-stellar-sdk/txnbuild#ManageData)
**Threshold**: Medium
**Result**: `ManageDataResult`
Expand Down
1 change: 1 addition & 0 deletions routes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@
/docs/learn/fundamentals/contract-development/overview
/docs/learn/fundamentals/contract-development/rust-dialect
/docs/learn/fundamentals/contract-development/storage
/docs/learn/fundamentals/contract-development/storage/manage-data
/docs/learn/fundamentals/contract-development/storage/persisting-data
/docs/learn/fundamentals/contract-development/storage/state-archival
/docs/learn/fundamentals/contract-development/types
Expand Down