Skip to content
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
3 changes: 2 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
STAKING_API_URL=https://staking-api.stakely.io/docs
STAKING_API_DOC_JSON_URL=https://staking-api.stakely.io/docs-json
STAKING_API_DOC_JSON_URL=https://staking-api.stakely.io/docs-json
APP_URL=https://app.stakely.io
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
STAKING_API_URL=https://dev-staking-api.stakely.io/docs
STAKING_API_DOC_JSON_URL=https://dev-staking-api.stakely.io/docs-json
APP_URL=https://dev-app.stakely.io
3 changes: 3 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
STAKING_API_URL=https://staking-api.stakely.io/docs
STAKING_API_DOC_JSON_URL=https://staking-api.stakely.io/docs-json
APP_URL=https://app.stakely.io
33 changes: 11 additions & 22 deletions docs/staking-api/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,31 @@
sidebar_position: 4
---

import AppUrl from '@site/src/components/AppUrl';

# Authentication

This page outlines the necessary steps and protocols for securely interacting with our API, ensuring that your data remains safe and your transactions are securely processed.

## Auth

## Auth Endpoints

These endpoints are designed to handle requests related to user authentication and security, ensuring that only authorized users can access specific functionalities of the system:


- **Register** [`/api/v1/auth/email/register`](/staking-api/api-reference#tag/auth/post/api/v1/auth/email/register) Although you can register using your desired email and password, your account will need to be manually activated. Please contact us before using this endpoint.
- **Login** [`/api/v1/auth/email/login`](/staking-api/api-reference#tag/auth/post/api/v1/auth/email/login) Use this endpoint to login and retrieve the JWT token, used to manage API keys.
- **Manage API Keys** [`/apikeys`](/staking-api/api-reference#tag/apikeys) This includes creating new API keys, listing all your existing keys, and deleting any keys that are no longer needed.

## Beta Stage Registration
To use the Staking API, you must be registered with an account on <AppUrl />. If you don't have an account yet, you can <AppUrl path="/sign-up">register here</AppUrl>.

As Stakely's Staking API is currently in the beta stage, registering to use our service requires manual whitelisting. If you wish to try our product, please reach out to us.
Once registered, <AppUrl path="/sign-in">login into your account</AppUrl>, you'll have access to all the products that Stakely offers, all using the same simplified account.

Manage your API keys in the Staking API dashboard at <AppUrl path="/staking-api" />. The dashboard provides a simple interface to create new keys, view existing keys, and delete keys you no longer need.

## Using the API Keys

To interact with the crafting and reporting aspects of our API, you must use the API keys obtained through the admin endpoints. The key must be included as an authorization header in your requests.
To access the crafting and reporting endpoints, you must authenticate using API keys generated through the Staking API web app at <AppUrl />.


:::info
Authentication for these endpoints is based on JSON Web Tokens (JWT).
:::


Once logged in with the user, you will receive a JWT that can be used to create new API keys. API keys are only returned upon creation. Be sure to copy and save the API key in a secure location. Afterwards, you can still manage, list, edit, and delete existing API keys with the login endpoint.

The header used for API key authentication is `X-API-KEY`.
Include your API key in the `X-API-KEY` header with every request:
```http
X-API-KEY: your-api-key-here
```

For examples and pre-created code snippets in various programming languages, which will help you integrate our services smoothly, please refer to our API schema available [here](/staking-api/api-reference).


## Security and Verification

Ensuring the security of all transactions and data exchanges remains our top priority. To accomplish this, we have implemented a method where the signature of each HTTP response can be found in the header under the name `x-signature`. This signature is the SHA256 hash of the HTTP response body, signed using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the SECP256k1 curve. To verify the integrity and authenticity of the data received, you must use the corresponding public key, which is readily accessible on the expandable bellow.
Expand Down
8 changes: 0 additions & 8 deletions docs/staking-api/ethereum/native-staking/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ sidebar_position: 2

import StakingOpenApiLink from '@site/src/components/StakingOpenApiLink';


## API Usage
Once you already have access to the Staking API with a validated user and existing apikeys you can start using this service.

:::warning

In order to use this module endpoints, **you will need to request access to stakely [email protected]**.

<u>The module is restricted for whitelisted users</u>.
:::

### API Reference docs

:::tip
Expand Down
41 changes: 41 additions & 0 deletions docs/staking-api/ethereum/stakewise-staking/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ You can check the **Staking API Reference** here:

In order to use staking api related endpoints you need to include your **API KEY**

:::tip

**Heads up!**
To obtain a valid API key required for authentication, please refer to the [Authentication > Auth](/staking-api/authentication#auth) section of the documentation.

:::

**Header:**

| Name | Description | Example value | Required
Expand Down Expand Up @@ -204,3 +211,37 @@ At url param you will need to pass the `address` you want to retrieve actions fr

Array of [`StakewiseGetExitedBalanceResponseDto`](/staking-api/api-reference#model/stakewisegetexitedbalanceresponsedto)

____


### Vault info

Get stakewise vault info such as APY and balance for the current time


- Endpoint: [`/api/v1/eth/stakewise/{chainId}/vault​​`](/staking-api/api-reference#tag/eth-stakewise/get/api/v1/eth/stakewise/{chainId}/vault)

#### Description

Get vault details, as current APY

#### Returned

Array of [`StakewiseGetVaultResponseDto`](/staking-api/api-reference#model/stakewisegetvaultresponsedto)

____


### User Stats

Get user stats for stakewise vault for N days

- Endpoint: [`/api/v1/eth/stakewise/{chainId}/stats/{address}`](/staking-api/api-reference#tag/eth-stakewise/get/api/v1/eth/stakewise/{chainId}/stats/{address})

#### Description

Get vault details, as current APY

#### Returned

Array of [`StakewiseGetUserStatsResponseDto`](/staking-api/api-reference#model/stakewisegetuserstatsresponsedto)
3 changes: 2 additions & 1 deletion docs/staking-api/supported-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ This page provides a comprehensive list of the blockchain networks currently sup
| Omniflix | ✅ | ❌ |
| Juno | ✅ | ❌ |
| Ethereum (native) | ✅ | ❌ |
| Ethereum (Stakewise) | ✅ | ❌ |
| Ethereum mainnet (Stakewise) | ✅ | ❌ |
| Ethereum hoodi (Stakewise) | ✅ | ❌ |
| Solana | ✅ | ❌ |
| Injective | ❌ | ❌ |
| Sui | ❌ | ❌ |
Expand Down
7 changes: 4 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ import {themes as prismThemes} from 'prism-react-renderer';
const config = {
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: 'throw',
}
},
customFields: {
stakingApiUrl: process.env.STAKING_API_URL,
appUrl: process.env.APP_URL,
},
title: 'Stakely Docs',
favicon: 'img/favicon.ico',
Expand All @@ -29,9 +33,6 @@ const config = {
organizationName: 'stakely', // Usually your GitHub org/user name.
projectName: 'stakely-docs', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
Expand Down
Loading