-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from everstake/feat/utils-lib
Berrachain as separated lib, common utils
- Loading branch information
Showing
17 changed files
with
7,634 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"semi": true, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }, | ||
], | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.