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

📝 add some informations about SDK environment #28

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ boost-title = 2
boost-hierarchy = 2
boost-paragraph = 1
expand = true
heading-split-level = 2
heading-split-level = 2
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
Loading