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

Berrachain as separated lib, common utils #51

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
23 changes: 23 additions & 0 deletions berrachain/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
7 changes: 7 additions & 0 deletions berrachain/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
61 changes: 61 additions & 0 deletions berrachain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Everstake Wallet SDK - Berrachain

## Getting Started

You can use two different options to implement staking for Everstake validator.

## Option 1: REST API

You can use REST API to call methods which are described in [Swagger](https://wallet-sdk-api.everstake.one/swagger/) with detailed examples

```
https://wallet-sdk-api.everstake.one
```

## Option 2: TypeScript library

You can install and import Wallet SDK for Javascript/TypeScript.

### Step. 1: Installing the Library

Install the npm library by copying the code below.

```sh
$ npm install @everstake/wallet-sdk-berrachain
```

or you can also use yarn

```sh
$ yarn add @everstake/wallet-sdk-berrachain
```

or you can use pnpm

```sh
$ pnpm add @everstake/wallet-sdk-berrachain
```

### Step. 2: Import Wallet SDK

After installing the app, you can import module Berrachain and use the SDK:

#### Import ES6

```ts
// import modules
import { Berrachain } from '@everstake/wallet-sdk-berrachain';
```

#### Import ES5

```ts
// import modules
const { Berrachain } = require('@everstake/wallet-sdk-berrachain');

```

## Questions and Feedback

If you have any questions, issues, or feedback, please file an issue
on [GitHub](https://github.com/everstake/wallet-sdk/issues).
20 changes: 20 additions & 0 deletions berrachain/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';

export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.strict,
eslintPluginPrettierRecommended,
{
rules: {
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
],
},
},
];
9 changes: 9 additions & 0 deletions berrachain/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
};

export default config;
62 changes: 62 additions & 0 deletions berrachain/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "@everstake/wallet-sdk-berrachain",
"version": "0.0.1",
"description": "Berrachain - Everstake Wallet SDK",
"publishConfig": {
"access": "public"
},
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"sideEffects": false,
"scripts": {
"build": "pnpm run prebuild && tsup src/index.ts --format cjs,esm --dts",
"type-check": "tsc",
"lint": "eslint 'src/**/*.{ts,tsx}'",
"prettier": "prettier --write 'src/**/*.{ts,tsx}'",
"test": "jest",
"prebuild": "pnpm run type-check && pnpm run lint"
},
"keywords": [
"berrachain",
"blockchain",
"everstake",
"wallet sdk"
],
"repository": {
"type": "git",
"url": "git+https://github.com/everstake/wallet-sdk.git"
},
"author": "Everstake",
"license": "ISC",
"bugs": {
"url": "https://github.com/everstake/wallet-sdk/issues"
},
"homepage": "https://github.com/everstake/wallet-sdk#readme",
"dependencies": {
"bignumber.js": "^9.1.2",
"web3": "^4.14.0"
},
"devDependencies": {
"@eslint/js": "^9.7.0",
"@jest/types": "^29.6.3",
"@types/jest": "^29.5.12",
"eslint": "9.x",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.8.0",
"jest": "^29.7.0",
"prettier": "^3.3.3",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"tsup": "^8.2.2",
"typescript": "^5.5.3",
"typescript-eslint": "^7.17.0"
}
}
Loading
Loading