Skip to content

Commit

Permalink
Documentation (#143)
Browse files Browse the repository at this point in the history
* GITBOOK-34: No subject

* GITBOOK-35: update issuing your first asset tutorial

* GITBOOK-36: update CD tutorial

* GITBOOK-37: update profiler plugin

* GITBOOK-38: Remove soroban token duplicate link

* GITBOOK-39: update soroban token handler

* GITBOOK-40: Improve Validation Cloud RPC page

* GITBOOK-41: Improve the Welcome Page

* GITBOOK-42: Improve Quick Start page

* GITBOOK-45: Soroban Auth Pipeline

* GITBOOK-47: update general doc

---------

Co-authored-by: Fernanda Hahn <[email protected]>
  • Loading branch information
fazzatti and Fernanda Hahn authored May 2, 2024
1 parent c715a46 commit 663ff70
Show file tree
Hide file tree
Showing 33 changed files with 413 additions and 522 deletions.
Binary file added docs/.gitbook/assets/image (1) (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/image (2) (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (2) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image (2).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 45 additions & 46 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
# Table of contents

* [Welcome](README.md)
* [Quick Start](quick-start.md)
- [Welcome](README.md)
- [Quick Start](quick-start.md)
- [Welcome](README.md)
- [Quick Start](quick-start.md)

## 🎓 Tutorials

* [Issuing your first asset](tutorials/issuing-your-first-asset.md)
* [Bulk Payments](tutorials/bulk-payments.md)
* [E2E Certificate of Deposit demo](tutorials/e2e-certificate-of-deposit-demo.md)
* [Creating a new contract client](tutorials/e2e-certificate-of-deposit-demo-1.md)
* [Profiling a contract](tutorials/e2e-certificate-of-deposit-demo-2.md)
- [Issuing your first asset](tutorials/issuing-your-first-asset.md)
- [Bulk Payments](tutorials/bulk-payments.md)
- [E2E Certificate of Deposit demo](tutorials/e2e-certificate-of-deposit-demo.md)
- [Creating a new contract client](tutorials/e2e-certificate-of-deposit-demo-1.md)

## 📄 Reference

* [Account](reference/account/README.md)
* [Base](reference/account/base.md)
* [Default Account Handler](reference/account/default-account-handler.md)
* [Freighter Account Handler](reference/account/freighter-account-handler.md)
* [Helpers](reference/account/helpers/README.md)
* [Friendbot](reference/account/helpers/friendbot.md)
* [Asset](reference/asset/README.md)
* [Classic Asset Handler](reference/asset/classic-asset-handler.md)
* [Stellar Asset Contract Handler](reference/asset/stellar-asset-contract-handler.md)
* [Soroban Token Handler](reference/asset/soroban-token-handler.md)
* [Constants](reference/constants.md)
* [Contract Clients](reference/contracts/README.md)
* [Certificate of Deposit Client](reference/contracts/certificate-of-deposit-client.md)
* [Core](reference/core/README.md)
* [Contract Engine](reference/core/contract-engine.md)
* [Pipelines](reference/core/pipelines/README.md)
* [Build Transaction](reference/core/pipelines/build-transaction.md)
* [Classic Signing Requirements](reference/core/pipelines/classic-signing-requirements.md)
* [Fee Bump](reference/core/pipelines/fee-bump.md)
* [Sign Transaction](reference/core/pipelines/sign-transaction.md)
* [Simulate Transaction](reference/core/pipelines/simulate-transaction.md)
* [Soroban Get Transaction](reference/core/pipelines/soroban-get-transaction.md)
* [Submit Transaction](reference/core/pipelines/submit-transaction.md)
* [Soroban Transaction](reference/core/pipelines/soroban-transaction.md)
* [Classic Transaction](reference/core/pipelines/classic-transaction.md)
* [Utils](reference/utils/README.md)
* [Plugins](reference/utils/plugins/README.md)
* [Fee Bump Plugin](reference/utils/plugins/fee-bump-plugin.md)
* [Channel Accounts Plugin](reference/utils/plugins/channel-accounts-plugin.md)
* [Auto Restore Plugin](reference/utils/plugins/auto-restore-plugin.md)
* [Profiler Plugin](reference/utils/plugins/profiler-plugin.md)
* [Pipeline](reference/utils/pipeline/README.md)
* [Conveyor Belt](reference/utils/pipeline/conveyor-belt.md)
* [Multi-belt Pipeline](reference/utils/pipeline/multi-belt-pipeline.md)
* [Network Handler](reference/network-handler/README.md)
* [RPC](reference/network-handler/rpc/README.md)
* [Default RPC Handler](reference/network-handler/rpc/default-rpc-handler.md)
* [Validation Cloud RPC Handler](reference/network-handler/rpc/validation-cloud-rpc-handler.md)
* [Horizon Handler](reference/network-handler/horizon-handler.md)
- [Account](reference/account/README.md)
- [Base](reference/account/base.md)
- [Default Account Handler](reference/account/default-account-handler.md)
- [Freighter Account Handler](reference/account/freighter-account-handler.md)
- [Asset](reference/asset/README.md)
- [Classic Asset Handler](reference/asset/classic-asset-handler.md)
- [Stellar Asset Contract Handler](reference/asset/stellar-asset-contract-handler.md)
- [Soroban Token Handler](reference/asset/soroban-token-handler.md)
- [Network](reference/constants.md)
- [Contract Clients](reference/contracts/README.md)
- [Certificate of Deposit Client](reference/contracts/certificate-of-deposit-client.md)
- [Core](reference/core/README.md)
- [Contract Engine](reference/core/contract-engine.md)
- [Pipelines](reference/core/pipelines/README.md)
- [Build Transaction](reference/core/pipelines/build-transaction.md)
- [Classic Signing Requirements](reference/core/pipelines/classic-signing-requirements.md)
- [Fee Bump](reference/core/pipelines/fee-bump.md)
- [Sign Transaction](reference/core/pipelines/sign-transaction.md)
- [Soroban Auth](reference/core/pipelines/sign-transaction-1.md)
- [Simulate Transaction](reference/core/pipelines/simulate-transaction.md)
- [Soroban Get Transaction](reference/core/pipelines/soroban-get-transaction.md)
- [Submit Transaction](reference/core/pipelines/submit-transaction.md)
- [Soroban Transaction](reference/core/pipelines/soroban-transaction.md)
- [Classic Transaction](reference/core/pipelines/classic-transaction.md)
- [Utils](reference/utils/README.md)
- [Plugins](reference/utils/plugins/README.md)
- [Fee Bump Plugin](reference/utils/plugins/fee-bump-plugin.md)
- [Channel Accounts Plugin](reference/utils/plugins/channel-accounts-plugin.md)
- [Auto Restore Plugin](reference/utils/plugins/auto-restore-plugin.md)
- [Profiler Plugin](reference/utils/plugins/profiler-plugin.md)
- [Pipeline](reference/utils/pipeline/README.md)
- [Conveyor Belt](reference/utils/pipeline/conveyor-belt.md)
- [Multi-belt Pipeline](reference/utils/pipeline/multi-belt-pipeline.md)
- [RPC](reference/rpc/README.md)
- [Default RPC Handler](reference/rpc/default-rpc-handler.md)
- [Validation Cloud RPC Handler](reference/rpc/validation-cloud-rpc-handler.md)
- [Horizon Handler](reference/horizon-handler.md)
2 changes: 1 addition & 1 deletion docs/reference/account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Accounts in Stellar Plus are represented in a few different ways that abstract t


{% hint style="info" %}
Tip: Depending on the arguments provided when initializing an Account, extra helpers will be made available in the instance of that account. See[helpers](helpers/ "mention") for further information.
Tip: Depending on the arguments provided when initializing an Account, extra helpers will be made available in the instance of that account. See[Broken link](broken-reference "mention") for further information.
{% endhint %}

&#x20;
2 changes: 1 addition & 1 deletion docs/reference/account/default-account-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ const myAccount = new StellarPlus.Account.DefaultAccountHandler({})
```
{% endcode %}
When using this option, be aware that the keys are merely generated locally, the account still won't exist in the Stellar network until a 'create account' operation is performed. For this, when using test networks that have a Friendbot, one can make use of the 'Friendbot' helper for Accounts to initialize the account with some lumens funds. Refer to the article [friendbot.md](helpers/friendbot.md "mention") for more detail.
When using this option, be aware that the keys are merely generated locally, the account still won't exist in the Stellar network until a 'create account' operation is performed. For this, when using test networks that have a Friendbot, one can make use of the 'Friendbot' helper for Accounts to initialize the account with some lumens funds. Refer to the article [Broken link](broken-reference "mention") for more detail.
28 changes: 0 additions & 28 deletions docs/reference/account/helpers/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/reference/account/helpers/friendbot.md

This file was deleted.

146 changes: 72 additions & 74 deletions docs/reference/asset/soroban-token-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,104 +6,102 @@ The `SorobanTokenHandler` is a key component of the Stellar Plus library, design

### Core Features

* **Upload WASM**: Facilitates the uploading of contract WASM files to the network.
* **Deploy Contract**: Allows for the deployment of new Soroban Token contracts.
* **Initialize Contract**: Provides the ability to initialize a contract with specific parameters such as admin, decimals, and token name.
* **Read From Contract (Simulations)**: Supports the simulation of contract method calls without altering the contract's state.
* **Invoke Contract (Executions)**: Enables the execution of contract methods that alter the contract's state.
- **Upload WASM**: Facilitates the uploading of contract WASM files to the network.
- **Deploy Contract**: Allows for the deployment of new Soroban Token contracts.
- **Initialize Contract**: Provides the ability to initialize a contract with specific parameters such as admin, decimals, and token name.
- **Read From Contract (Simulations)**: Supports the simulation of contract method calls without altering the contract's state.
- **Invoke Contract (Executions)**: Enables the execution of contract methods that alter the contract's state.

### Constructor Parameters

The `SorobanTokenHandler` constructor accepts the following parameters:

```typescript
export type SorobanTokenHandlerConstructorArgs = {
networkConfig: NetworkConfig;
contractParameters?: {
spec?: ContractSpec;
contractId?: string;
wasm?: Buffer;
wasmHash?: string;
};
options?: {
sorobanTransactionPipeline?:{
plugins?: SorobanTransactionPipelinePlugin[];
customRpcHandler?: RpcHandler;
}
};
};
networkConfig: NetworkConfig
contractParameters?: {
spec?: ContractSpec
contractId?: string
wasm?: Buffer
wasmHash?: string
}
options?: {
sorobanTransactionPipeline?: {
plugins?: SorobanTransactionPipelinePlugin[]
customRpcHandler?: RpcHandler
}
}
}
```
* `networkConfig`: The Stellar network configuration (testnet or public).
* `contractParameters`: Optional core parameters used by the Contract Engine to interact with this contract.
* `spec`: Optional contract specification object. The class already contains a default contract specification which is used by default, so only provide a spec when necessary to use your own custom specification.
* `contractId`: Optional identifier of the deployed contract.
* `wasm`: Optional Buffer of the loaded WASM file with compiled contract code.
* `wasmHash`: Optional hash of the deployed WASM code.
* `Options`: Options that the underlying Contract Engine and its internal mechanisms accept to personalize its behavior
* `sorobanTransactionPipeline`: Parameters that can be provided to the [internal soroban transaction pipeline](../core/pipelines/soroban-transaction.md).
* `plugins`: Array of middleware plugins supported by the Soroban Transaction pipeline that can personalize soroban transactions processing.
* `customRrpcHandler`: Optional [RPC handler ](../network-handler/rpc/)for interacting with the Stellar network.


- `networkConfig`: The Stellar network configuration (testnet or public).
- `contractParameters`: Optional core parameters used by the Contract Engine to interact with this contract.
- `spec`: Optional contract specification object. The class already contains a default contract specification which is used by default, so only provide a spec when necessary to use your own custom specification.
- `contractId`: Optional identifier of the deployed contract.
- `wasm`: Optional Buffer of the loaded WASM file with compiled contract code.
- `wasmHash`: Optional hash of the deployed WASM code.
- `Options`: Options that the underlying Contract Engine and its internal mechanisms accept to personalize its behavior
- `sorobanTransactionPipeline`: Parameters that can be provided to the [internal soroban transaction pipeline](../core/pipelines/soroban-transaction.md).
- `plugins`: Array of middleware plugins supported by the Soroban Transaction pipeline that can personalize soroban transactions processing.
- `customRrpcHandler`: Optional [RPC handler ](../rpc/)for interacting with the Stellar network.
{% hint style="info" %}
This class can be initialized in different forms. In case you have an instance of soroban token already live, you can simply provide the Contract ID and proceed with the contract invocations.\
\
Refer to [#contract-initialization-with-contract-engine](../core/contract-engine.md#contract-initialization-with-contract-engine "mention") for more details.
Refer to [#contract-initialization-with-contract-engine](../core/contract-engine.md#contract-initialization-with-contract-engine 'mention') for more details.
{% endhint %}
### Methods
#### Administrative Methods
* **initialize**: Initializes the contract instance.
* Arguments: admin (string), decimal (u32), name (string), symbol (string), and other transaction invocation parameters.
* Output: Promise\<void>.
* **setAdmin**: Sets a new admin for the contract.
* Arguments: id (string), new\_admin (string), and other transaction invocation parameters.
* Output: Promise\<void>.
* **admin**: Retrieves the admin account's public key.
* Arguments: Transaction invocation parameters.
* Output: Promise\<string>.
- **initialize**: Initializes the contract instance.
- Arguments: admin (string), decimal (u32), name (string), symbol (string), and other transaction invocation parameters.
- Output: Promise\<void>.
- **setAdmin**: Sets a new admin for the contract.
- Arguments: id (string), new_admin (string), and other transaction invocation parameters.
- Output: Promise\<void>.
- **admin**: Retrieves the admin account's public key.
- Arguments: Transaction invocation parameters.
- Output: Promise\<string>.
#### Token Operations
* **mint**: Mints tokens to a specified account.
* Arguments: to (string), amount (i128), and other transaction invocation parameters.
* Output: Promise\<void>.
* **clawback**: Withdraws tokens from an account.
* Arguments: from (string), amount (i128), and other transaction invocation parameters.
* Output: Promise\<void>.
* **allowance**: Checks the allowance of a spender by an account.
* Arguments: from (string), spender (string), and other simulation invocation parameters.
* Output: Promise\<i128>.
- **mint**: Mints tokens to a specified account.
- Arguments: to (string), amount (i128), and other transaction invocation parameters.
- Output: Promise\<void>.
- **clawback**: Withdraws tokens from an account.
- Arguments: from (string), amount (i128), and other transaction invocation parameters.
- Output: Promise\<void>.
- **allowance**: Checks the allowance of a spender by an account.
- Arguments: from (string), spender (string), and other simulation invocation parameters.
- Output: Promise\<i128>.
#### User Methods
* **approve**: Approves a spender to spend a specified amount on behalf of an account.
* Arguments: from (string), spender (string), amount (i128), live\_until\_ledger (u32), and other transaction invocation parameters.
* Output: Promise\<void>.
* **balance**: Retrieves the balance of an account.
* Arguments: id (string) and other simulation invocation parameters.
* Output: Promise\<i128>.
* **transfer**: Transfers tokens from one account to another.
* Arguments: from (string), to (string), amount (i128), and other transaction invocation parameters.
* Output: Promise\<void>.
* **transferFrom**: Executes a transfer on behalf of a spender.
* Arguments: spender (string), from (string), to (string), amount (i128), and other transaction invocation parameters.
* Output: Promise\<void>.
* **burn**: Burns a specified amount of tokens from an account.
* Arguments: from (string), amount (i128), and other transaction invocation parameters.
* Output: Promise\<void>.
* **decimals**: Retrieves the number of decimals for the token.
* Arguments: Simulation invocation parameters.
* Output: Promise\<u32>.
* **name**: Retrieves the token's name.
* Arguments: Simulation invocation parameters.
* Output: Promise\<string>.
* **symbol**: Retrieves the token's symbol.
* Arguments: Simulation invocation parameters.
* Output: Promise\<string>.
- **approve**: Approves a spender to spend a specified amount on behalf of an account.
- Arguments: from (string), spender (string), amount (i128), live_until_ledger (u32), and other transaction invocation parameters.
- Output: Promise\<void>.
- **balance**: Retrieves the balance of an account.
- Arguments: id (string) and other simulation invocation parameters.
- Output: Promise\<i128>.
- **transfer**: Transfers tokens from one account to another.
- Arguments: from (string), to (string), amount (i128), and other transaction invocation parameters.
- Output: Promise\<void>.
- **transferFrom**: Executes a transfer on behalf of a spender.
- Arguments: spender (string), from (string), to (string), amount (i128), and other transaction invocation parameters.
- Output: Promise\<void>.
- **burn**: Burns a specified amount of tokens from an account.
- Arguments: from (string), amount (i128), and other transaction invocation parameters.
- Output: Promise\<void>.
- **decimals**: Retrieves the number of decimals for the token.
- Arguments: Simulation invocation parameters.
- Output: Promise\<u32>.
- **name**: Retrieves the token's name.
- Arguments: Simulation invocation parameters.
- Output: Promise\<string>.
- **symbol**: Retrieves the token's symbol.
- Arguments: Simulation invocation parameters.
- Output: Promise\<string>.
This documentation provides a concise technical overview of the `SorobanTokenHandler`, outlining its purpose, core features, constructor parameters, and a comprehensive list of its methods with their respective arguments and outputs.
10 changes: 7 additions & 3 deletions docs/reference/constants.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Constants
# Network

A collection of ready-to-use configuration to the most common networks and a function set your own custom configuration.

| Item | Description |
| --------- | ------------------------------------------------------------------------------------ |
| testnet | Standard configuration parameters to connect and interact with the Stellar testnet |
| futurenet | Standard configuration parameters to connect and interact with the Stellar futurenet |
| TestNet | Standard configuration parameters to connect and interact with the Stellar testnet |
| FutureNet | Standard configuration parameters to connect and interact with the Stellar futurenet |
| MainNet | Standard configuration parameters to connect and interact with the Stellar mainnet |
| CustomNet | A function to build you own configuration object |
Loading

0 comments on commit 663ff70

Please sign in to comment.