Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Refresh six classic guides #723

Draft
wants to merge 78 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a125983
🔁 Channel accounts: explain resolutions
JFWooten4 Jun 20, 2024
01424db
🔁 Channel accounts: simplify narrative
JFWooten4 Jun 22, 2024
37e38c3
🔁 Channel accounts: specify cards
JFWooten4 Jun 23, 2024
9ed2a0a
🔁 Channel accounts: finalize visuals
JFWooten4 Jun 23, 2024
44309a2
🔁 Channel accounts: simplify narrative
JFWooten4 Jun 26, 2024
dd7d761
🔁 Channel accounts: expand details
JFWooten4 Jun 26, 2024
c4a46dc
Merge branch 'stellar:main' into refresh-classic-guides
JFWooten4 Jul 5, 2024
68f165d
🔁 Channel accounts: hyperlinks, context
JFWooten4 Jul 7, 2024
07e613a
🔁 Channel accounts: initial diagrams
JFWooten4 Jul 9, 2024
bf6e15f
🔁 Channel accounts: reference configuration
JFWooten4 Jul 9, 2024
15d1288
🔁 Channel accounts: KaTeX formatting
JFWooten4 Jul 10, 2024
b874bc7
🔁 Channel accounts: context, links
JFWooten4 Jul 10, 2024
e290fb3
🔁 Channel accounts: conceptual images
JFWooten4 Jul 12, 2024
1f8a904
🔁 Channel accounts: simplify image
JFWooten4 Jul 12, 2024
46f49c6
🔁 Channel accounts: prioritize readability
JFWooten4 Jul 14, 2024
3f2e731
🔁 Channel accounts: overload example
JFWooten4 Jul 14, 2024
8a3d963
🔁 Channel accounts: configuration example
JFWooten4 Jul 15, 2024
cd7f447
🫴🏽 Claimable balances: first example
JFWooten4 Jul 18, 2024
e2248db
🫴🏽 Claimable balances: second example
JFWooten4 Jul 29, 2024
1992240
🫴🏽 Claimable balances: third example
JFWooten4 Jul 29, 2024
ee6175a
🫴🏽 Claimable balances: expand precomputation
JFWooten4 Aug 2, 2024
95ffe3c
🔎 Refresh: asset design considerations
JFWooten4 Aug 5, 2024
d93ae63
🦞 Clawbacks: confer readable diction
JFWooten4 Aug 5, 2024
e1611fc
🦞 Clawbacks: minor example diction
JFWooten4 Aug 5, 2024
03ac66d
🦞 Clawbacks: format account names
JFWooten4 Aug 5, 2024
86f3ca8
🦞 Clawbacks: format more names
JFWooten4 Aug 5, 2024
d1a9252
🦞 Clawbacks: apply name diction
JFWooten4 Aug 5, 2024
eb0e9be
🦞 Clawbacks: translate preamble example
JFWooten4 Aug 6, 2024
f4ad468
🦞 Clawbacks: expand example one
JFWooten4 Aug 6, 2024
e72e4a8
🦞 Clawbacks: translate next instances
JFWooten4 Aug 6, 2024
09fa456
🦞 Clawbacks: continue example dev
JFWooten4 Aug 6, 2024
b3e3230
💱 Trading examples: add lumenaut
JFWooten4 Aug 8, 2024
ee66e13
⏬ Prep for GH sync
JFWooten4 Aug 12, 2024
364f656
Merge remote-tracking branch 'upstream/main' into refresh-classic-guides
JFWooten4 Aug 12, 2024
6e866b7
Merge remote-tracking branch 'upstream/main' into refresh-classic-guides
JFWooten4 Aug 21, 2024
080ec03
💱 Trading examples: clarify narrative
JFWooten4 Sep 13, 2024
b529869
💱 Trading examples: contextualize sources
JFWooten4 Sep 13, 2024
127142e
↕️ Merge branch with self
JFWooten4 Sep 13, 2024
fea178f
🙌 Missed a reference link
JFWooten4 Sep 13, 2024
1a12877
💱 Trading examples: sell offers
JFWooten4 Sep 16, 2024
550b941
💱 Trading examples: level two
JFWooten4 Sep 16, 2024
fff2713
💱 Trading examples: time & sales
JFWooten4 Sep 16, 2024
06d249d
Merge remote-tracking branch 'upstream/main' into refresh-classic-guides
JFWooten4 Sep 30, 2024
4658706
🔁 Sync, move work items
JFWooten4 Sep 30, 2024
760d423
🔁 Clarify channel context links
JFWooten4 Oct 1, 2024
3d30353
🔁 Further advance text flow
JFWooten4 Oct 4, 2024
f6691fa
🔁 Start last code examples
JFWooten4 Oct 7, 2024
b273d71
🔁 Remove random channel generation
JFWooten4 Oct 7, 2024
954210d
🔁 Rest of authorization example
JFWooten4 Oct 7, 2024
ce8d61e
🔁 Remove adding channel custody
JFWooten4 Oct 7, 2024
7cb4b01
🔁 Clear up last tasks
JFWooten4 Oct 7, 2024
56c608a
🔁 Start state rotation example
JFWooten4 Oct 7, 2024
f83f4ad
🔁 Temporary merge, nonfinal publication
JFWooten4 Oct 11, 2024
1a91082
🔗 Minimum compilation link requirements
JFWooten4 Oct 15, 2024
11555a0
🖌️ Prettier compilation demo fixes
JFWooten4 Oct 15, 2024
d521205
🔁 Clarify base fee, miscellaneous 🤝🏻
JFWooten4 Oct 16, 2024
33f342e
Merge branch 'stellar:main' into refresh-classic-guides
JFWooten4 Oct 17, 2024
09fffca
👽 Translate java to JS
JFWooten4 Oct 19, 2024
03d2199
🔁 Last example java & go
JFWooten4 Oct 22, 2024
1c8851d
Merge branch 'stellar:main' into refresh-classic-guides
JFWooten4 Oct 22, 2024
cb9687a
🔁 Closing example explanation, diagrams
JFWooten4 Oct 22, 2024
06183cc
🔁 Put back `set timeouts`
JFWooten4 Oct 22, 2024
cbe3aca
🔁 Cleanup remaining frame items
JFWooten4 Oct 23, 2024
b45f8b2
🔁 Comment active-tense transitive verbs
JFWooten4 Oct 23, 2024
a73d966
🔁 Finalize the story flow
JFWooten4 Oct 23, 2024
a3c5d64
🔁 Polish off minor syntax
JFWooten4 Oct 23, 2024
eac05da
🔗 Remove depricated community link
JFWooten4 Oct 27, 2024
91b40fd
🔎 Clarify note on trustlines
JFWooten4 Oct 27, 2024
7109cb5
🫴🏽 Finish most cleaning up
JFWooten4 Nov 4, 2024
320de48
Merge branch 'main' into refresh-classic-guides
JFWooten4 Nov 4, 2024
0948700
🔗 Update simplified syntax reference
JFWooten4 Nov 4, 2024
19fbf45
🦞 Clean up final examples
JFWooten4 Nov 4, 2024
75a3ea0
💱 Remove items explicitly moved
JFWooten4 Nov 5, 2024
9bc3c63
💱 Remove duplicate placeholder drafts
JFWooten4 Nov 5, 2024
2a2638c
💱 Sidebar section intro description
JFWooten4 Nov 5, 2024
9d01898
💱 First rewrite run through
JFWooten4 Nov 6, 2024
32455bb
💱 Clean up scaffolding leftovers
JFWooten4 Nov 19, 2024
da7e8a3
💱 Translate starting AMM preamble
JFWooten4 Nov 19, 2024
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
2 changes: 1 addition & 1 deletion docs/build/guides/tokens/stellar-asset-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ client.mint(...);

## Testing

Soroban Rust SDK provides an easy way to instantiate a Stellar Asset Contract tokens using `register_stellar_asset_contract_v2`. This function can be seen as the deployment of a generic token. It also allows you to manipulate flags on the issuer account like `AUTH_REVOCABLE` and `AUTH_REQUIRED`. In the following example, we are following the best practices outlined in the [Issuing and Distribution Accounts section](../../../tokens/control-asset-access.mdx#issuing-and-distribution-accounts):
Soroban Rust SDK provides an easy way to instantiate a Stellar Asset Contract tokens using `register_stellar_asset_contract_v2`. This function can be seen as the deployment of a generic token. It also allows you to manipulate flags on the issuer account like `AUTH_REVOCABLE` and `AUTH_REQUIRED`. In the following example, we are following the best practices outlined in the [Issuing and Distribution Accounts section](../../../tokens/control-asset-access.mdx#issuer-and-distributor-accounts):

```rust
#![cfg(test)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: retrieve-an-order-book
title: "Retrieve an Order Book"
description: "The order book endpoint provides an order book's bids and asks and can be used in [streaming](https://developers.stellar.org/docs/data/horizon/api-reference/structure/streaming) mode."
description: "The order book endpoint provides an order book's bids and asks and can be used in streaming mode."
sidebar_label: "Retrieve an Order Book"
hide_title: true
hide_table_of_contents: true
Expand Down
16 changes: 16 additions & 0 deletions docs/data/horizon/api-reference/structure/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ sidebar_label: Structure
description: Horizon is an API for interacting with the Stellar network.
---

import { MethodTable } from "@site/src/components/MethodTable";

How Horizon is structured.

<MethodTable title="Structure Types">

| | |
| ------------------------------------------------- | --- |
| [Response Format](./response-format.mdx) | |
| [Page Arguments](./pagination/page-arguments.mdx) | |
| [Streaming](./streaming.mdx) | |
| [Rate Limiting](./rate-limiting.mdx) | |
| [XDR](./xdr.mdx) | |
| [Consistency](./consistency.mdx) | |
| [Pagination](./pagination/README.mdx) | |

</MethodTable>
4 changes: 3 additions & 1 deletion docs/learn/encyclopedia/sdex/README.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
title: SDEX
title: The SDEX
sidebar_position: 90
---

import DocCardList from "@theme/DocCardList";

Native network markets, liquidity, and conversions for all assets.

<DocCardList />
1,310 changes: 1,029 additions & 281 deletions docs/learn/encyclopedia/sdex/liquidity-on-stellar-sdex-liquidity-pools.mdx

Large diffs are not rendered by default.

234 changes: 234 additions & 0 deletions docs/learn/encyclopedia/security/signatures-multisig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ sidebar_position: 20

import { CodeExample } from "@site/src/components/CodeExample";

:::danger TODO

let's walk though creating a custodied solution akin to FT [`href`] and then break down the implications re CAP23 pending merges

:::

:::note

This section details signing non-smart contract transactions. For auth related to smart contract transactions, see [authorization](./authorization.mdx)
Expand Down Expand Up @@ -40,6 +46,234 @@ In some cases, a transaction may need more than one signature:

Each additional signer beyond the master key increases the account’s minimum balance by one base reserve. Up to 20 signatures can be attached to one transaction. Once a signature threshold is met, if there are leftover signatures, the transaction will fail. For example, if your transaction requires three signatures, providing more than three signatures, even if they are all valid, will result in a failed transaction error: `TX_BAD_AUTH_EXTRA`. This design is because unnecessary signature verification has a large effect on performance before accepting transactions in consensus.

`example five signers each own auth, collectively cannot change signers`

REQUIRES: server, primaryAccountSecret, &primaryAccount primatives

```python
channelAccPubKeys = [
"GA7WHVWBBUCVKVZ35GM5FVGZXZYJ63EFDB5VTFV2TRF4KLUXWN6CSIJL",
"GD4EITS74V4RN5XOKO42DX2SRR3NI5JVC3LFUWIAVQH2PXBUEKLZU6V3",
"GCEO3FNAOF7VKBRD22JHMT3Q5IVVUPDEICBKZNTKL7KUBOX6EDYYYTG4",
"GAUTAZU2E6VUFOPRDOYAMYQBD7JU3XRLODSKLQL4EXIYUDB22FFPYDJC",
"GBACJWSCHTRILBAPVOYXCVIFGUF7FSHTEKMITBI5ESCEQVEIJ6QFV4P5"
]

primaryPubKey = "GC5AT5GU7WI5NHHRM4XH2ALBOQS5I2MTLNYH5RTEJZC5LWCKVN52SVBV"
primaryAccount = server.load_account(primaryPubKey)

def generateChannelAccounts(primaryPubKey, channelAccPubKeys, primaryAccountSecret):
transactionBuilder = TransactionBuilder(
source_account = primaryAccount,
network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE,
base_fee = 100
)

for channelPubKeys in channelAccPubKeys:
transactionBuilder.append_create_account_op(
destination = channelPubKey,
starting_balance = "4.4"
)

transaction = transactionBuilder.build()
transaction.sign(primarySecretKey)
return server.submit_transaction(transaction)

def authorizeChannelAccounts(primaryPubKey, channelAccPubKeys, primaryAccountSecret):
transactionBuilder = TransactionBuilder(
source_account = primaryAccount,
network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE,
base_fee = 100
)

transactionBuilder.append_set_options_op(
high_threshold = 44,
master_weight = 44,
medium_threshold = 3
)

for channelPubKeys in channelAccPubKeys:
transactionBuilder.append_set_options_op(
signer={
"ed25519PublicKey": channelPubKey,
"weight": 3
}
)
```

```js
const channelAccPubKeys = [
"GA7WHVWBBUCVKVZ35GM5FVGZXZYJ63EFDB5VTFV2TRF4KLUXWN6CSIJL",
"GD4EITS74V4RN5XOKO42DX2SRR3NI5JVC3LFUWIAVQH2PXBUEKLZU6V3",
"GCEO3FNAOF7VKBRD22JHMT3Q5IVVUPDEICBKZNTKL7KUBOX6EDYYYTG4",
"GAUTAZU2E6VUFOPRDOYAMYQBD7JU3XRLODSKLQL4EXIYUDB22FFPYDJC",
"GBACJWSCHTRILBAPVOYXCVIFGUF7FSHTEKMITBI5ESCEQVEIJ6QFV4P5",
];

const primaryPubKey =
"GC5AT5GU7WI5NHHRM4XH2ALBOQS5I2MTLNYH5RTEJZC5LWCKVN52SVBV";
const primaryAccount = server.loadAccount(primaryPubKey);

async function generateChannelAccounts(primaryAccountSecret) {
const transactionBuilder = new StellarSdk.TransactionBuilder(primaryAccount, {
fee: StellarSdk.BASE_FEE,
networkPassphrase: StellarSdk.Networks.TESTNET,
});

channelAccPubKeys.forEach((channelPubKey) => {
transactionBuilder.addOperation(
StellarSdk.Operation.createAccount({
destination: channelPubKey,
startingBalance: "4.4",
}),
);
});

const transaction = transactionBuilder.build();
transaction.sign(primaryKeypair);
const result = await server.submitTransaction(transaction);
}

async function authorizeChannelAccounts(primaryAccountSecret) {
const transactionBuilder = new StellarSdk.TransactionBuilder(primaryAccount, {
fee: StellarSdk.BASE_FEE,
networkPassphrase: StellarSdk.Networks.TESTNET,
});

transactionBuilder.addOperation(
StellarSdk.Operation.setOptions({
highThreshold: 44,
masterWeight: 44,
mediumThreshold: 3,
}),
);

channelAccPubKeys.forEach((channelPubKey) => {
transactionBuilder.addOperation(
StellarSdk.Operation.setOptions({
signer: {
ed25519PublicKey: channelPubKey,
weight: 3,
},
}),
);
});
}
```

```java
private static final List<String> channelAccPubKeys = Arrays.asList(
"GA7WHVWBBUCVKVZ35GM5FVGZXZYJ63EFDB5VTFV2TRF4KLUXWN6CSIJL",
"GD4EITS74V4RN5XOKO42DX2SRR3NI5JVC3LFUWIAVQH2PXBUEKLZU6V3",
"GCEO3FNAOF7VKBRD22JHMT3Q5IVVUPDEICBKZNTKL7KUBOX6EDYYYTG4",
"GAUTAZU2E6VUFOPRDOYAMYQBD7JU3XRLODSKLQL4EXIYUDB22FFPYDJC",
"GBACJWSCHTRILBAPVOYXCVIFGUF7FSHTEKMITBI5ESCEQVEIJ6QFV4P5"
);
private static final String primaryPubKey = "GC5AT5GU7WI5NHHRM4XH2ALBOQS5I2MTLNYH5RTEJZC5LWCKVN52SVBV";
private static final AccountResponse primaryAccount = server.accounts().account(primaryPubKey);

public static void generateChannelAccounts(String primaryAccountSecret) throws Exception {
Transaction.Builder transactionBuilder = new Transaction.Builder(primaryAccount, Network.TESTNET)
.setBaseFee(Transaction.MIN_BASE_FEE)

for (String channelPubKeys : channelAccPubKeys) {
transactionBuilder.addOperation(
new CreateAccountOperation.Builder(channelPubKeys, startingBalance).build()
);
}

Transaction transaction = transactionBuilder.build();
transaction.sign(primaryKeypair);

SubmitTransactionResponse response = server.submitTransaction(transaction);
System.out.println("Transaction successful: " + response);
}

public static void authorizeChannelAccounts(String primaryAccountSecret) throws Exception {

Transaction.Builder transactionBuilder = new Transaction.Builder(primaryAccount, Network.TESTNET)
.setBaseFee(Transaction.MIN_BASE_FEE)

transactionBuilder.addOperation(
new SetOptionsOperation.Builder()
.setHighThreshold(44)
.setMasterKeyWeight(44)
.setMediumThreshold(3)
.build()
);

for (String channelPubKeys : channelAccPubKeys) {
transactionBuilder.addOperation(
new SetOptionsOperation.Builder()
.setSigner(new Signer.SignerKeyEd25519(channelPubKeys), 3)
.build()
);
}
}
```

```go
var (
channelAccPubKeys = []string{
"GA7WHVWBBUCVKVZ35GM5FVGZXZYJ63EFDB5VTFV2TRF4KLUXWN6CSIJL",
"GD4EITS74V4RN5XOKO42DX2SRR3NI5JVC3LFUWIAVQH2PXBUEKLZU6V3",
"GCEO3FNAOF7VKBRD22JHMT3Q5IVVUPDEICBKZNTKL7KUBOX6EDYYYTG4",
"GAUTAZU2E6VUFOPRDOYAMYQBD7JU3XRLODSKLQL4EXIYUDB22FFPYDJC",
"GBACJWSCHTRILBAPVOYXCVIFGUF7FSHTEKMITBI5ESCEQVEIJ6QFV4P5",
}
primaryPubKey = "GC5AT5GU7WI5NHHRM4XH2ALBOQS5I2MTLNYH5RTEJZC5LWCKVN52SVBV"
)

func generateChannelAccounts(primaryAccountSecret string) {
tx, err := txnbuild.NewTransaction(
txnbuild.TransactionParams{
SourceAccount: &primaryAccount,
IncrementSequenceNum: true,
BaseFee: txnbuild.MinBaseFee,
Operations: []txnbuild.Operation{},
},
)
check(err)

for _, channelPubKey := range channelAccPubKeys {
createOp := txnbuild.CreateAccount{
Destination: channelPubKey,
Amount: "4.4",
}
tx.Operations = append(tx.Operations, &createOp)
}
}

func authorizeChannelAccounts(primaryAccountSecret string) {
tx, err := txnbuild.NewTransaction(
txnbuild.TransactionParams{
SourceAccount: &primaryAccount,
IncrementSequenceNum: true,
BaseFee: txnbuild.MinBaseFee,
Operations: []txnbuild.Operation{},
},
)
check(err)

setThreshOp := txnbuild.SetOptions{
HighThreshold: txnbuild.NewThreshold(44),
MasterWeight: txnbuild.NewThreshold(44),
MediumThreshold: txnbuild.NewThreshold(3),
}
tx.Operations = append(tx.Operations, &setThreshOp)

for _, channelPubKey := range channelAccPubKeys {
addSignerOp := txnbuild.SetOptions{
Signer: &txnbuild.Signer{
Address: channelPubKey,
Weight: txnbuild.NewThreshold(3)
},
}
tx.Operations = append(tx.Operations, &addSignerOp)
}
}
```

### Alternate signature types

To enable some advanced smart contract features there are a couple of additional signature types. These signature types also have weights and can be added and removed similarly to normal signature types. But rather than check a cryptographic signature for authorization they have a different method of proving validity to the network.
Expand Down
Loading
Loading