Skip to content

Commit

Permalink
📝 add some informations about SDK environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Burg committed Dec 18, 2023
1 parent 7f03adf commit 74fc8d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
4 changes: 3 additions & 1 deletion docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ boost-title = 2
boost-hierarchy = 2
boost-paragraph = 1
expand = true
heading-split-level = 2
heading-split-level = 2

[preprocessor.embed]
2 changes: 1 addition & 1 deletion docs/src/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# API

You can find API specifications [here](https://ghostnet.gas-station-api.marigold.dev/docs)
<iframe width="1080" height="915" src="https://ghostnet.gas-station-api.marigold.dev/docs"></iframe>
15 changes: 13 additions & 2 deletions docs/src/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ npm install --save @marigold-dev/gas-station-lib

#### Explanations

The SDK consists of two classes : `GasStation` and `PermitContract`.
The SDK consists of two classes: `GasStation` and `PermitContract`.

There are also two variables:
- `GAS_STATION_PUBLIC_API_GHOSTNET` which redirect to [https://ghostnet.gas-station-api.marigold.dev/operation](https://ghostnet.gas-station-api.marigold.dev/operation)
- `GAS_STATION_PUBLIC_API_MAINNET` which redirect to [https://gas-station-api.marigold.dev/operation](https://gas-station-api.marigold.dev/operation) (Not available yet)

The `GasStation` class enables easy communication with the Gas Station API without the need to manually initialize the HTTP request.

Expand Down Expand Up @@ -66,8 +70,15 @@ To begin, you need to import and initialize the `GasStation` object from the SDK
```ts
import { GasStation } from '@marigold-dev/gas-station-lib'

const gasApi = new GasStation()
```

ℹ️ NOTE: By default, the Gas Station used by the SDK is on Ghostnet but you can also provide a `apiURL` like:
```ts
import { GasStation, GAS_STATION_PUBLIC_API_GHOSTNET} from '@marigold-dev/gas-station-lib'

const gasApi = new GasStation({
apiURL: 'https://gas-station-api.marigold.dev/'
apiURL: GAS_STATION_PUBLIC_API_GHOSTNET // or the URL directly
})
```

Expand Down
13 changes: 6 additions & 7 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ The goal here is for the user to initiate the mint action and retrieve their NFT

First, we'll setup the GasStation SDK as follows:
```ts
const gasStationAPI = new GasStation({
apiURL: PUBLIC_GAS_STATION_API
})
const gasStationAPI = new GasStation()
```
ℹ️ `PUBLIC_GAS_STATION_API` is an environment variable available in `.env`
ℹ️ `GasStation` class will target the Gas Station deployed on Ghostnet by default.

Next, we'll retrieve an instance of our contract, using [Taquito](https://tezostaquito.io/).

Expand Down Expand Up @@ -81,10 +79,11 @@ For staking, we need a permit. Staking involves transferring our freshly minted
To facilitate the development of this new feature, we will also use the TypeScript SDK (for reference, you have all the information [here](./library.md))

To start, let's initialize the `GasStation` and `PermitContract` classes from the SDK:

ℹ️ `GasStation` class will target the Gas Station deployed on Ghostnet by default.

```ts
const gasStationApi = new GasStation({
apiURL: PUBLIC_GAS_STATION_API
});
const gasStationApi = new GasStation();
const permitContract = new PermitContract(PUBLIC_PERMIT_CONTRACT, Tezos);
```

Expand Down

0 comments on commit 74fc8d7

Please sign in to comment.