Skip to content

aurora-is-near/aurora-staking-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3c331fc · Nov 11, 2024

History

32 Commits
Nov 11, 2024
Nov 6, 2024
Nov 11, 2024
Nov 6, 2024
Nov 6, 2024
Nov 6, 2024
Nov 6, 2024
Nov 6, 2024
Nov 6, 2024
Nov 6, 2024
Nov 11, 2024
Nov 6, 2024
Nov 6, 2024
Nov 6, 2024
Nov 11, 2024
Nov 6, 2024
Nov 10, 2024

Repository files navigation

Aurora Staking SDK

A React library that contains logic for staking and unstaking AURORA.

Installation

yarn add @aurora-is-near/staking

Usage

Wrap your application in a StakingProvider:

import { StakingProvider } from '@aurora-is-near/staking';

<StakingProvider
  network="mainnet"
  getStreamPrices={() => ({
    prices: [100, 200],
    marketCaps: [1000, 2000],
  })}
>
  {/** ... */}
</StakingProvider>

The getStreamPrices function is responsible for taking a list of CoinGecko token names (as defined in the config.ts) and returning the USD prices and market caps for each.

Staking functionality can be accessed via the useStaking hook.