Skip to content

Commit

Permalink
PR adding our API docs in the OpenAPI spec to our docs (#23)
Browse files Browse the repository at this point in the history
* reorder the docs content as well as add basic /api route

* slight linting stuff

* ran mdx linter

* little lint fix

* noop

* update some docs links

* update welcome page

* added fundamentals and concepts and deleted old start directory

* new tools and sdks docs

* new glossary

* glossary -> encyclopedia

* updated encyclopedia

* Added code blocks (#10)

* Added code blocks

Please look at why it won't tab out the code blocks!

* added json5 and missing python library

Co-authored-by: Tyler van der Hoeven <[email protected]>

* Added code blocks (#13)

* Added missing information to operations (#11)

* Added missing information to operations

Including: LPs, clawbacks, claimable balances

* Update list-of-operations.mdx

Co-authored-by: Tyler van der Hoeven <[email protected]>

* Added code blocks (#14)

* delete some dupe content

* Added code blocks (#15)

* Added code blocks

Please look at why it won't tab out the code blocks!

* added json5 and missing python library

* Added code blocks

* spaces matter apparently

* nvm

Co-authored-by: Tyler van der Hoeven <[email protected]>

* Added code blocks (#16)

* Added code blocks & missing link (#17)

* Added code block (#20)

* Added code blocks, edited some content (#22)

Removed Example 5 (to be added later)

* spacing tweaks

* Added code blocks (#21)

* omit CodeExample block on non code blocks

* Added code blocks (#18)

* Added code blocks

* encyclopedia

* space tweak

Co-authored-by: Tyler van der Hoeven <[email protected]>

* Added code blocks (#19)

* Added code blocks

* removed some spaces

Co-authored-by: Tyler van der Hoeven <[email protected]>

* missed a couple imports

* glossary -> encyclopedia

* lint

* format mdx

* no cache on the make

* case fix step 1

* case fix step 2

* fixed a link

* added another link from the hash

* Update sponsored-reserves.mdx

* Update docusaurus.config.js

* Glossary-Encyclopedia network passphrases

* Anchoring assets-xborder payments links

* Update setting-up-test-server.mdx

* Update withdraw-anchored-assets.mdx

* Update custom-assets.mdx

* Update first-deposit.mdx

* Update project-setup.mdx

* Update setup-custodial-account.mdx

* Update anatomy-of-an-asset.mdx

* Update control-asset-access.mdx

* Issuing assets - control asset access

* Issuing assets - publishing asset info

* run core node - configuring links

* Update monitoring.mdx

* Tutorials - create account

* Update setting-up-production-server.mdx

* tutorials - follow received payments links

* tutorials - send and receive payments links

* run a core node - index links

* Added community (#25)

Add and update community channels

* link tweaks

* couple more tweaks

* glossary links

* issuing assets - anatomy of an asset link

* encyclopedia - claimable balance links

* encyclopedia - error handling links

* encyclopedia - fee bump links

* Update fees-surge-pricing-fee-strategies.mdx

* Update ledger-headers.mdx

* encyclopedia - flags links

* Update claimable-balances.mdx

* Update error-handling.mdx

* Update fee-bump-transactions.mdx

* encyclopedia - liquidity on stellar links

* encyclopedia - memos links

* encyclopedia - path payments links

* encyclopedia - pooled accounts links

* encyclopedia - signatures and multisig links

* encyclopedia - sponsored reserves links

* fundamentals & concepts - data strctr - accts links

* f&c - data structures - assets links

* f&c - data structures - ledgers links

* f&c - data structures - operations & transactions links

* f&c - operations links

* f&c - lumens links

* f&c - testnet&pubnet links

* updated link in pooled accounts

* added sdk library link

* minor link tweaks

* minor styling update for h4s

* updates

* oops

* updates

* Update docusaurus.config.js

* Merging Personal Fork into API-Content Branch (#38)

* Don't merge #1

* Finishing Account Schema

* TransactionSchemaUpdate

* Server Update

* Finished Account Copy

* Documenting Retrieve Account Response

* Documenting Account Responses #2

* Learned how to bundle api

* Trades & Offers

* Base Asset Update

* Adding Ledger Endpoint

* Adding Ledger Endpoint

* Operations Objects

* Hmm the page is broken?

* package updates

* might allow the previews to build?

* nope, nice try though

* that

* maybe that?

* shruggers

* Adding CB, LP, OB

* Last Endpoints FS TA

* Fixed Environment

* Fixed Environment

* Migrate components

* Add config and update dependencies

* Add swizzled layout

* Add api content and build spec pages

* streaming endpoints, Renaming OperationID, sidebar

* Setup sidebar generator for api

* Generate api docs and migrate index/object pages

* Add streaming hints

* Remove padding from pagination

* Handle data types with skip

* Adding All Examples , Replacing Casing, Update Par

* Updating Broken API links & Fixing Sidebar

* Resource Links Updated, Category Jsons fixed

* Add all operation objects

* noop

* noop

* attempt at a tweak for the nginx

* maybe

* Updating Broken Links

* Fixing Broken Links. Adding redirects

* Delete _category_.json

* remove those for now

* serve /api/introduction at /api

* redirect root to /docs

* maybe

* /shrug

* uno mas

* fix a broken link

* few more link updates and fix the yarn.lock error

* don't lint while running CI

* throw on broken links

* minor update to openapi-docs plugin

---------

Co-authored-by: Bri <[email protected]>
Co-authored-by: Taylor-at-Stellar <[email protected]>
Co-authored-by: Taylor-at-steller <[email protected]>
Co-authored-by: Jesmar Castillo <[email protected]>
  • Loading branch information
5 people authored Feb 23, 2023
1 parent cded8bf commit 788cc25
Show file tree
Hide file tree
Showing 275 changed files with 29,761 additions and 2,622 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
- name: Format MDX with Prettier
run: yarn check:mdx

- name: Lint with ESLint
run: yarn lint:fix
# - name: Lint with ESLint
# run: yarn lint:fix
4 changes: 4 additions & 0 deletions api/aggregations/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 30,
"label": "Aggregations"
}
5 changes: 5 additions & 0 deletions api/aggregations/fee-stats/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"position": 50,
"label": "Fee Stats"
}

16 changes: 16 additions & 0 deletions api/aggregations/fee-stats/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Fee Stats
sidebar_position: 10
---

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

Fee stats are used to predict what fee to set for a transaction before submitting it to the network.

<EndpointsTable title="Endpoints">

| | |
| --- | -------------------------- |
| GET | [/fee-stats](./single.mdx) |

</EndpointsTable>
169 changes: 169 additions & 0 deletions api/aggregations/fee-stats/object.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
---
title: The Fee Stats Object
sidebar_position: 20
---

import { ExampleResponse } from "@site/src/components/ExampleResponse";
import { AttributeTable } from "@site/src/components/AttributeTable";

When Horizon returns fee stats, it uses the format below.

Note: The `fee_charged` represents the actual fee paid for the transaction, while `max_fee` represents the maximum bid the transaction creator was willing to pay for the transaction.

<AttributeTable>

- ATTRIBUTE
- DATA TYPE
- DESCRIPTION
- last_ledger
- string
- The last ledger's sequence number.
- last_ledger_base_fee
- string
- The base fee as defined in the last ledger.
- ledger_capacity_usage
- string
- The average capacity usage over the last 5 ledgers (0 is no usage, 1.0 is completely full ledgers).
- fee_charged
- object
- Information about the fee charged for transactions in the last 5 ledgers.
- min
- string
- Minimum fee charged over the last 5 ledgers.
- mode
- string
- Mode fee charged over the last 5 ledgers.
- p10
- string
- 10th percentile fee charged over the last 5 ledgers.
- p20
- string
- 20th percentile fee charged over the last 5 ledgers.
- p30
- string
- 30th percentile fee charged over the last 5 ledgers.
- p40
- string
- 40th percentile fee charged over the last 5 ledgers.
- p50
- string
- 50th percentile fee charged over the last 5 ledgers.
- p60
- string
- 60th percentile fee charged over the last 5 ledgers.
- p70
- string
- 70th percentile fee charged over the last 5 ledgers.
- p80
- string
- 80th percentile fee charged over the last 5 ledgers.
- p90
- string
- 90th percentile fee charged over the last 5 ledgers.
- p95
- string
- 95th percentile fee charged over the last 5 ledgers.
- p99
- string
- 99th percentile fee charged over the last 5 ledgers.
- max_fee
- object
- Information about max fee bid for transactions over the last 5 ledgers.
- min
- string
- Minimum (lowest) value of the maximum fee bid over the last 5 ledgers.
- mode
- string
- Mode max fee over the last 5 ledgers.
- p10
- string
- 10th percentile max fee charged over the last 5 ledgers.
- p20
- string
- 20th percentile max fee charged over the last 5 ledgers.
- p30
- string
- 30th percentile max fee charged over the last 5 ledgers.
- p40
- string
- 40th percentile max fee charged over the last 5 ledgers.
- p50
- string
- 50th percentile max fee charged over the last 5 ledgers.
- p60
- string
- 60th percentile max fee charged over the last 5 ledgers.
- p70
- string
- 70th percentile max fee charged over the last 5 ledgers.
- p80
- string
- 80th percentile max fee charged over the last 5 ledgers.
- p90
- string
- 90th percentile max fee charged over the last 5 ledgers.
- p95
- string
- 95th percentile max fee charged over the last 5 ledgers.
- p99
- string
- 99th percentile max fee charged over the last 5 ledgers.

</AttributeTable>

<ExampleResponse>

```json
{
"last_ledger": "28444678",
"last_ledger_base_fee": "100",
"ledger_capacity_usage": "0.2",
"min_accepted_fee": "100",
"mode_accepted_fee": "100",
"p10_accepted_fee": "100",
"p20_accepted_fee": "100",
"p30_accepted_fee": "100",
"p40_accepted_fee": "100",
"p50_accepted_fee": "100",
"p60_accepted_fee": "100",
"p70_accepted_fee": "100",
"p80_accepted_fee": "100",
"p90_accepted_fee": "100",
"p95_accepted_fee": "100",
"p99_accepted_fee": "10000",
"fee_charged": {
"max": "100",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "100",
"p99": "100"
},
"max_fee": {
"max": "16000",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "100",
"p99": "10000"
}
}
```

</ExampleResponse>
98 changes: 98 additions & 0 deletions api/aggregations/fee-stats/single.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Retrieve Fee Stats
sidebar_position: 30
---

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

The fee stats endpoint provides information about per-operation fee stats over the last 5 ledgers.

<Endpoint>

| | |
| --- | ---------- |
| GET | /fee_stats |

</Endpoint>

<CodeExample title="Example Request">

```curl
curl "https://horizon.stellar.org/fee_stats"
```

```js
var StellarSdk = require("stellar-sdk");
var server = new StellarSdk.Server("https://horizon.stellar.org");

server
.feeStats()
.then(function (resp) {
console.log(resp);
})
.catch(function (err) {
console.error(err);
});
```

</CodeExample>

<ExampleResponse title="Example Response">

```json
{
"last_ledger": "28444696",
"last_ledger_base_fee": "100",
"ledger_capacity_usage": "0.19",
"min_accepted_fee": "100",
"mode_accepted_fee": "100",
"p10_accepted_fee": "100",
"p20_accepted_fee": "100",
"p30_accepted_fee": "100",
"p40_accepted_fee": "100",
"p50_accepted_fee": "100",
"p60_accepted_fee": "100",
"p70_accepted_fee": "100",
"p80_accepted_fee": "100",
"p90_accepted_fee": "100",
"p95_accepted_fee": "100",
"p99_accepted_fee": "120",
"fee_charged": {
"max": "100",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "100",
"p99": "100"
},
"max_fee": {
"max": "16000",
"min": "100",
"mode": "100",
"p10": "100",
"p20": "100",
"p30": "100",
"p40": "100",
"p50": "100",
"p60": "100",
"p70": "100",
"p80": "100",
"p90": "100",
"p95": "100",
"p99": "120"
}
}
```

</ExampleResponse>
19 changes: 19 additions & 0 deletions api/aggregations/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Aggregations
sidebar_position: 30
---

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

Endpoints that aggregate data about the ledger.

<MethodTable title="Resource Types">

| | |
| ---------------------------------------------------- | --- |
| [Order Books](./order-books/index.mdx) | |
| [Paths](./paths/index.mdx) | |
| [Trade Aggregations](./trade-aggregations/index.mdx) | |
| [Fee Stats](./fee-stats/index.mdx) | |

</MethodTable>
4 changes: 4 additions & 0 deletions api/aggregations/order-books/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 10,
"label": "Order Books"
}
18 changes: 18 additions & 0 deletions api/aggregations/order-books/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Order Books
sidebar_position: 0
---

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

An order book is a collections of offers for a specific pair of assets.

Learn more about [order books](../../../docs/glossary/#decentralized-exchange).

<EndpointsTable title="Endpoints">

| | |
| --- | --------------------------- |
| GET | [/order_book](./single.mdx) |

</EndpointsTable>
Loading

0 comments on commit 788cc25

Please sign in to comment.