Skip to content

Commit

Permalink
Updating old docs url to new docs urls (stellar#714)
Browse files Browse the repository at this point in the history
* Updating old docs url to new docs urls

* Better more useful links to the docs
  • Loading branch information
Paul Bellamy authored Sep 28, 2021
1 parent 4531155 commit 83e5da1
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 68 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,12 @@ There is also a [sample](https://github.com/fnando/rn-stellar-sdk-sample) that y
## Usage
For information on how to use js-stellar-sdk, take a look at the
[Developers site](https://www.stellar.org/developers/js-stellar-sdk/reference/).
For information on how to use js-stellar-sdk, take a look at [the
documentation](https://stellar.github.io/js-stellar-sdk/), or [the
examples](https://github.com/stellar/js-stellar-sdk/tree/master/docs/reference).
There is also API Documentation
[here](https://www.stellar.org/developers/horizon/reference/index.html).
There is also Horizon REST API Documentation
[here](https://developers.stellar.org/api/introduction/).
## Testing
Expand Down Expand Up @@ -226,7 +227,7 @@ cd jsdoc && serve .
## Documentation

Documentation for this repo lives in
[Developers site](https://www.stellar.org/developers/js-stellar-sdk/reference/).
[Developers site](https://github.com/stellar/js-stellar-sdk/blob/master/docs/reference/readme.md).

## Contributing

Expand Down
6 changes: 3 additions & 3 deletions docs/reference/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: Basic Examples

## Creating a payment transaction

The `js-stellar-sdk` exposes the [`TransactionBuilder`](https://stellar.github.io/js-stellar-base/TransactionBuilder.html) class from `js-stellar-base`. There are more examples of [building transactions here](https://www.stellar.org/developers/js-stellar-base/reference/base-examples.html). All those examples can be signed and submitted to Stellar in a similar manner as is done below.
The `js-stellar-sdk` exposes the [`TransactionBuilder`](https://stellar.github.io/js-stellar-base/TransactionBuilder.html) class from `js-stellar-base`. There are more examples of [building transactions here](https://github.com/stellar/js-stellar-base/blob/master/docs/reference/base-examples.md). All those examples can be signed and submitted to Stellar in a similar manner as is done below.

In this example, the destination account must exist. The example is written
using modern Javascript, but `await` calls can also be rendered with promises.
Expand Down Expand Up @@ -74,7 +74,7 @@ const server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
}))
// Make this transaction valid for the next 30 seconds only
.setTimeout(30)
// Uncomment to add a memo (https://www.stellar.org/developers/guides/concepts/transactions.html)
// Uncomment to add a memo (https://developers.stellar.org/docs/glossary/transactions/)
// .addMemo(StellarSdk.Memo.text('Hello world!'))
.build();

Expand Down Expand Up @@ -148,4 +148,4 @@ const es = server.payments()
})
```

For more on streaming events, please check out [the Horizon documentation](https://www.stellar.org/developers/horizon/reference/streaming.html) and this [guide to server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
For more on streaming events, please check out [the Horizon documentation](https://developers.stellar.org/api/introduction/streaming/) and this [guide to server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
10 changes: 5 additions & 5 deletions docs/reference/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ js-stellar-sdk gives you access to all the endpoints exposed by Horizon.
## Building requests
js-stellar-sdk uses the [Builder pattern](https://en.wikipedia.org/wiki/Builder_pattern) to create the requests to send
to Horizon. Starting with a [server](https://stellar.github.io/js-stellar-sdk/Server.html) object, you can chain methods together to generate a query.
(See the [Horizon reference](https://www.stellar.org/developers/reference/) documentation for what methods are possible.)
(See the [Horizon reference](https://developers.stellar.org/api/) documentation for what methods are possible.)
```js
var StellarSdk = require('stellar-sdk');
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
Expand All @@ -33,7 +33,7 @@ Once the request is built, it can be invoked with `.call()` or with `.stream()`.
## Streaming requests
Many requests can be invoked with `stream()`. Instead of returning a promise like `call()` does, `.stream()` will return an `EventSource`.
Horizon will start sending responses from either the beginning of time or from the point specified with `.cursor()`.
(See the [Horizon reference](https://www.stellar.org/developers/horizon/reference/streaming.html) documentation to learn which endpoints support streaming.)
(See the [Horizon reference](https://developers.stellar.org/api/introduction/streaming/) documentation to learn which endpoints support streaming.)

For example, to log instances of transactions from a particular account:

Expand All @@ -57,7 +57,7 @@ var es = server.transactions()
## Handling responses

### XDR
The transaction endpoints will return some fields in raw [XDR](https://www.stellar.org/developers/guides/concepts/xdr.html)
The transaction endpoints will return some fields in raw [XDR](https://developers.stellar.org/api/introduction/xdr/)
form. You can convert this XDR to JSON using the `.fromXDR()` method.

An example of re-writing the txHandler from above to print the XDR fields as JSON:
Expand All @@ -73,7 +73,7 @@ var txHandler = function (txResponse) {


### Following links
The [HAL format](https://www.stellar.org/developers/horizon/reference/responses.html) links returned with the Horizon response are converted into functions you can call on the returned object.
The [HAL format](https://developers.stellar.org/api/introduction/response-format/) links returned with the Horizon response are converted into functions you can call on the returned object.
This allows you to simply use `.next()` to page through results. It also makes fetching additional info, as in the following example, easy:

```js
Expand All @@ -93,7 +93,7 @@ server.payments()

## Building transactions

See the [Building Transactions](https://www.stellar.org/developers/js-stellar-base/reference/building-transactions.html) guide for information about assembling a transaction.
See the [Building Transactions](https://github.com/stellar/js-stellar-base/blob/master/docs/reference/building-transactions.md) guide for information about assembling a transaction.

## Submitting transactions
Once you have built your transaction, you can submit it to the Stellar network with `Server.submitTransaction()`.
Expand Down
10 changes: 5 additions & 5 deletions src/account_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ServerApi } from "./server_api";
* Creates a new {@link AccountCallBuilder} pointed to server defined by serverUrl.
* Do not create this object directly, use {@link Server#accounts}.
*
* @see [All Accounts](https://www.stellar.org/developers/horizon/reference/resources/account.html)
* @see [All Accounts](https://developers.stellar.org/api/resources/accounts/)
* @class AccountCallBuilder
* @extends CallBuilder
* @constructor
Expand All @@ -24,7 +24,7 @@ export class AccountCallBuilder extends CallBuilder<
* Returns information and links relating to a single account.
* The balances section in the returned JSON will also list all the trust lines this account has set up.
*
* @see [Account Details](https://www.stellar.org/developers/horizon/reference/endpoints/accounts-single.html)
* @see [Account Details](https://developers.stellar.org/api/resources/accounts/single/)
* @param {string} id For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
* @returns {CallBuilder} a new CallBuilder instance for the /accounts/:id endpoint
*/
Expand All @@ -36,7 +36,7 @@ export class AccountCallBuilder extends CallBuilder<

/**
* This endpoint filters accounts by signer account.
* @see [Accounts](https://www.stellar.org/developers/horizon/reference/endpoints/accounts.html)
* @see [Accounts](https://developers.stellar.org/api/resources/accounts/list/)
* @param {string} value For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
* @returns {AccountCallBuilder} current AccountCallBuilder instance
*/
Expand All @@ -47,7 +47,7 @@ export class AccountCallBuilder extends CallBuilder<

/**
* This endpoint filters all accounts who are trustees to an asset.
* @see [Accounts](https://www.stellar.org/developers/horizon/reference/endpoints/accounts.html)
* @see [Accounts](https://developers.stellar.org/api/resources/accounts/list/)
* @see Asset
* @param {Asset} value For example: `new Asset('USD','GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD')`
* @returns {AccountCallBuilder} current AccountCallBuilder instance
Expand All @@ -59,7 +59,7 @@ export class AccountCallBuilder extends CallBuilder<

/**
* This endpoint filters accounts where the given account is sponsoring the account or any of its sub-entries..
* @see [Accounts](https://www.stellar.org/developers/horizon/reference/endpoints/accounts.html)
* @see [Accounts](https://developers.stellar.org/api/resources/accounts/list/)
* @param {string} value For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
* @returns {AccountCallBuilder} current AccountCallBuilder instance
*/
Expand Down
2 changes: 1 addition & 1 deletion src/account_response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ServerApi } from "./server_api";
* The balances section in the returned JSON will also list all the trust lines this account has set up.
* It also contains {@link Account} object and exposes it's methods so can be used in {@link TransactionBuilder}.
*
* @see [Account Details](https://www.stellar.org/developers/horizon/reference/endpoints/accounts-single.html)
* @see [Account Details](https://developers.stellar.org/api/resources/accounts/object/)
* @param {string} response Response from horizon account endpoint.
* @returns {AccountResponse} AccountResponse instance
*/
Expand Down
6 changes: 3 additions & 3 deletions src/call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class CallBuilder<
/**
* Creates an EventSource that listens for incoming messages from the server. To stop listening for new
* events call the function returned by this method.
* @see [Horizon Response Format](https://www.stellar.org/developers/horizon/reference/responses.html)
* @see [Horizon Response Format](https://developers.stellar.org/api/introduction/response-format/)
* @see [MDN EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource)
* @param {object} [options] EventSource options.
* @param {function} [options.onmessage] Callback function to handle incoming messages.
Expand Down Expand Up @@ -198,7 +198,7 @@ export class CallBuilder<

/**
* Sets `cursor` parameter for the current call. Returns the CallBuilder object on which this method has been called.
* @see [Paging](https://www.stellar.org/developers/horizon/reference/paging.html)
* @see [Paging](https://developers.stellar.org/api/introduction/pagination/)
* @param {string} cursor A cursor is a value that points to a specific location in a collection of resources.
* @returns {object} current CallBuilder instance
*/
Expand All @@ -209,7 +209,7 @@ export class CallBuilder<

/**
* Sets `limit` parameter for the current call. Returns the CallBuilder object on which this method has been called.
* @see [Paging](https://www.stellar.org/developers/horizon/reference/paging.html)
* @see [Paging](https://developers.stellar.org/api/introduction/pagination/)
* @param {number} number Number of records the server should return.
* @returns {object} current CallBuilder instance
*/
Expand Down
10 changes: 5 additions & 5 deletions src/effect_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ServerApi } from "./server_api";
*
* @class EffectCallBuilder
* @extends CallBuilder
* @see [All Effects](https://www.stellar.org/developers/horizon/reference/endpoints/effects-all.html)
* @see [All Effects](https://developers.stellar.org/api/resources/effects/)
* @constructor
* @param {string} serverUrl Horizon server URL.
*/
Expand All @@ -21,7 +21,7 @@ export class EffectCallBuilder extends CallBuilder<

/**
* This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
* @see [Effects for Account](https://www.stellar.org/developers/horizon/reference/endpoints/effects-for-account.html)
* @see [Effects for Account](https://developers.stellar.org/api/resources/accounts/effects/)
* @param {string} accountId For example: `GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD`
* @returns {EffectCallBuilder} this EffectCallBuilder instance
*/
Expand All @@ -33,7 +33,7 @@ export class EffectCallBuilder extends CallBuilder<
* Effects are the specific ways that the ledger was changed by any operation.
*
* This endpoint represents all effects that occurred in the given ledger.
* @see [Effects for Ledger](https://www.stellar.org/developers/horizon/reference/endpoints/effects-for-ledger.html)
* @see [Effects for Ledger](https://developers.stellar.org/api/resources/ledgers/effects/)
* @param {number|string} sequence Ledger sequence
* @returns {EffectCallBuilder} this EffectCallBuilder instance
*/
Expand All @@ -43,7 +43,7 @@ export class EffectCallBuilder extends CallBuilder<

/**
* This endpoint represents all effects that occurred as a result of a given transaction.
* @see [Effects for Transaction](https://www.stellar.org/developers/horizon/reference/endpoints/effects-for-transaction.html)
* @see [Effects for Transaction](https://developers.stellar.org/api/resources/transactions/effects/)
* @param {string} transactionId Transaction ID
* @returns {EffectCallBuilder} this EffectCallBuilder instance
*/
Expand All @@ -53,7 +53,7 @@ export class EffectCallBuilder extends CallBuilder<

/**
* This endpoint represents all effects that occurred as a result of a given operation.
* @see [Effects for Operation](https://www.stellar.org/developers/horizon/reference/endpoints/effects-for-operation.html)
* @see [Effects for Operation](https://developers.stellar.org/api/resources/operations/effects/)
* @param {number} operationId Operation ID
* @returns {EffectCallBuilder} this EffectCallBuilder instance
*/
Expand Down
16 changes: 8 additions & 8 deletions src/federation_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const FEDERATION_RESPONSE_MAX_SIZE = 100 * 1024;

/**
* FederationServer handles a network connection to a
* [federation server](https://www.stellar.org/developers/guides/concepts/federation.html)
* [federation server](https://developers.stellar.org/docs/glossary/federation/)
* instance and exposes an interface for requests to that instance.
* @constructor
* @param {string} serverURL The federation server URL (ex. `https://acme.com/federation`).
Expand Down Expand Up @@ -66,8 +66,8 @@ export class FederationServer {
* });
* ```
*
* @see <a href="https://www.stellar.org/developers/guides/concepts/federation.html" target="_blank">Federation doc</a>
* @see <a href="https://www.stellar.org/developers/guides/concepts/stellar-toml.html" target="_blank">Stellar.toml doc</a>
* @see <a href="https://developers.stellar.org/docs/glossary/federation/" target="_blank">Federation doc</a>
* @see <a href="https://developers.stellar.org/docs/issuing-assets/publishing-asset-info/" target="_blank">Stellar.toml doc</a>
* @param {string} value Stellar Address (ex. `bob*stellar.org`)
* @param {object} [opts] Options object
* @param {boolean} [opts.allowHttp] - Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
Expand Down Expand Up @@ -104,7 +104,7 @@ export class FederationServer {

/**
* Creates a `FederationServer` instance based on information from
* [stellar.toml](https://www.stellar.org/developers/guides/concepts/stellar-toml.html)
* [stellar.toml](https://developers.stellar.org/docs/issuing-assets/publishing-asset-info/)
* file for a given domain.
*
* If `stellar.toml` file does not exist for a given domain or it does not
Expand All @@ -118,7 +118,7 @@ export class FederationServer {
* // stellar.toml does not exist or it does not contain information about federation server.
* });
* ```
* @see <a href="https://www.stellar.org/developers/guides/concepts/stellar-toml.html" target="_blank">Stellar.toml doc</a>
* @see <a href="https://developers.stellar.org/docs/issuing-assets/publishing-asset-info/" target="_blank">Stellar.toml doc</a>
* @param {string} domain Domain to get federation server for
* @param {object} [opts] Options object
* @param {boolean} [opts.allowHttp] - Allow connecting to http servers, default: `false`. This must be set to false in production deployments!
Expand Down Expand Up @@ -162,7 +162,7 @@ export class FederationServer {

/**
* Get the federation record if the user was found for a given Stellar address
* @see <a href="https://www.stellar.org/developers/guides/concepts/federation.html" target="_blank">Federation doc</a>
* @see <a href="https://developers.stellar.org/docs/glossary/federation/" target="_blank">Federation doc</a>
* @param {string} address Stellar address (ex. `bob*stellar.org`). If `FederationServer` was instantiated with `domain` param only username (ex. `bob`) can be passed.
* @returns {Promise} Promise that resolves to the federation record
*/
Expand All @@ -186,7 +186,7 @@ export class FederationServer {

/**
* Given an account ID, get their federation record if the user was found
* @see <a href="https://www.stellar.org/developers/guides/concepts/federation.html" target="_blank">Federation doc</a>
* @see <a href="https://developers.stellar.org/docs/glossary/federation/" target="_blank">Federation doc</a>
* @param {string} accountId Account ID (ex. `GBYNR2QJXLBCBTRN44MRORCMI4YO7FZPFBCNOKTOBCAAFC7KC3LNPRYS`)
* @returns {Promise} A promise that resolves to the federation record
*/
Expand All @@ -199,7 +199,7 @@ export class FederationServer {

/**
* Given a transactionId, get the federation record if the sender of the transaction was found
* @see <a href="https://www.stellar.org/developers/guides/concepts/federation.html" target="_blank">Federation doc</a>
* @see <a href="https://developers.stellar.org/docs/glossary/federation/" target="_blank">Federation doc</a>
* @param {string} transactionId Transaction ID (ex. `3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889`)
* @returns {Promise} A promise that resolves to the federation record
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ledger_call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ServerApi } from "./server_api";
* Creates a new {@link LedgerCallBuilder} pointed to server defined by serverUrl.
* Do not create this object directly, use {@link Server#ledgers}.
*
* @see [All Ledgers](https://www.stellar.org/developers/horizon/reference/endpoints/ledgers-all.html)
* @see [All Ledgers](https://developers.stellar.org/api/resources/ledgers/list/)
* @constructor
* @class LedgerCallBuilder
* @extends CallBuilder
Expand Down
Loading

0 comments on commit 83e5da1

Please sign in to comment.