open-index/open-npm huggingface dataset:
npm package: @spidexjs/address-converter
Description: Address converter, convert ETH address to Ethermint/spidex address.
Latest version: 0.1.6

# Address converter

A simple converter between `ETH` address and `Ethermint`/`spidex` addresses.

## Installation

```sh
npm install @spidexjs/address-converter
```

## Usage

### Converter

```ts
import { ethToEthermint, ethermintToEth } from '@spidexjs/address-converter'

let address = ethToEthermint('0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71')
// "ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048"

let address = ethermintToEth('ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048')
// "0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71"
```

### Decoders

```ts
import { ETH, ETHERMINT } from '@spidexjs/address-converter'
let hex = ETH.decoder('0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71')
// hex.toString('hex') === "e2d61e49ff8a9d724cc54d338d8076f878ac6b71"

hex = ETHERMINT.decoder('ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048')
// hex.toString('hex') === "e2d61e49ff8a9d724cc54d338d8076f878ac6b71"
```

### Encoders

```ts
import { ETH, ETHERMINT } from '@spidexjs/address-converter'
let address = ETH.encoder(
  Buffer.from('e2d61e49ff8a9d724cc54d338d8076f878ac6b71', 'hex'),
)
// address === "0xe2D61e49ff8a9d724CC54d338D8076F878aC6b71"

address = ETHERMINT.encoder(
  Buffer.from('e2d61e49ff8a9d724cc54d338d8076f878ac6b71', 'hex'),
)
// address === "ethm1uttpuj0l32whynx9f5ecmqrklpu2c6m3973048"
```

### Spidex support

```ts
import { ethToSpidex, spidexToEth } from '@spidexjs/address-converter'

let address = ethToSpidex('0x1eb6169BD471ef45A1805f34A135eBd38EdF98eC')
// "0x1eb6169BD471ef45A1805f34A135eBd38EdF98eC"

let address = spidexToEth('0x1eb6169BD471ef45A1805f34A135eBd38EdF98eC')
// "0x1eb6169BD471ef45A1805f34A135eBd38EdF98eC"
```

## Reference

- [ENSDOMAINS-AddressEnconder](https://github.com/ensdomains/address-encoder)
npm package: @spidexjs/bridge
Description: bridge for spidex
Latest version: 0.1.6

# Bridge

## Installation

```sh
npm install @spidexjs/bridge
```

## Usage

### transfer from spidex -> osmosis
```ts
    
    import {sendContractEip712Token,sendIbcEip712Token} from "@spidexjs/bridge"
    
    const result:any = await sendContractEip712Token(
      OSMO_TOKEN_ADDRESS, // contract address
      toContractAddress,  //burn contract address
      account,
      asset,
    );

    if(result && result.status){
      const ibcResult = await sendIbcEip712Token(
        cosmosChainId,
        spxEvmChainId,
        sender,
        ibcDenom,
        account,
        asset,
        fromRest,
        targetRest,
        recipient,
      );
      // todo transferSuccess(ibcResult);
    }else{
      // todo transferFailed(result)
    }

```

### transfer from osmosis -> spidex
```ts

    import {sendIbcToken,sendConvertToken} from "@spidexjs/bridge"

    const result = await sendIbcToken(
      chainId,
      rpc,
      sendAddress,
      amount,
      recipient,
      denom,
      sourceChannel
    )
    if( result && result.code === 0){
      const convertResult = await sendConvertToken(
        cosmosChainId,
        spxEvmChainId,
        rest,
        amount,
        ibcDenom,
        recipient,
      );
      // todo transferSuccess(convertResult);
    }else{
      // todo transferFailed(result)
    }
```
npm package: @spidexjs/metamask-sign-recover-pubkey
Description: recover public key by metamask signature.
Latest version: 0.1.6

# metamask-sign-recover-pubkey

#### How to recover pubkey by metamask signature, 

### Metamask eth_getEncryptionPublicKey function cannot use 

```ts
ethereum
  .request({
    method: 'eth_getEncryptionPublicKey',
    params: [accounts[0]], // you must have access to the specified account
  })

 ```

### So we need get pubkey from signature

![img_1.png](img_1.png)img_1.png

## example
```ts
import {getPubkey} from "@spidexjs/metamask-sign-recover-pubkey";

const pubkey = await getPubkey(account.address);
console.log(pubkey);
// AiJbGH7xjbW7PoDClLDb3On9YgiWXQMq2cHIA1v4lfPj

```

```ts
  const {ethereum}: any = window;
 
  // message hex
  let message = arrayify(hashMessage('generate_pubkey'));
  let 0xhex = "0x" + ua2hex(message)
  const sign = await ethereum.request({method: "eth_sign", params: [address, 0xhex]});
  const pk = signatureToPubkey(
    sign,
    Buffer.from(message)
  )

  console.log('pubkey:', pk)
  
  //pubkey : AiJbGH7xjbW7PoDClLDb3On9YgiWXQMq2cHIA1v4lfPj
  return pk;
npm package: @spidexjs/proto
Description: Protobuf files for spidex.
Latest version: 0.1.7

# Proto

Protobuf files used to generate cosmos/spidex transactions.

## Convert protobuf to Eth Transaction

Example on how to convert protobuf message -> ethereum tx [here]('./tests/messages/msgEthereumTx.spec.ts')

## Local generation

Requirements:

- `brew install protoc`
- `npm install -g protoc-gen-ts`

To generate the protobuf files on linux instead of OSX, remove the empty string after `sed -i ''`

```sh
./scripts/get_proto_files.sh
./scripts/create_proto_files.sh
./scripts/remove_grpc.sh
./scripts/remove_unused_dependencies.sh
```

## Note

The lib `@grpc/grpc-js` was not included in the `package.json`, and all the services were manually removed from the autogenerated proto files to avoid having that dependency.
This lib is just a tool to create the transactions, not to interact with a GRPC server, if you need the complete proto file you can locally run `./scripts/get_proto_files.sh` and `./scripts/create_proto_files.sh`
npm package: @spidy092/auth-client
Description: Scalable frontend auth SDK for centralized login using Keycloak + Auth Service.
Author: Spiddyy
Latest version: 3.0.5

# auth-client SDK

A lightweight, framework-agnostic authentication client SDK designed for scalable React (and non-React) apps using centralized login via Keycloak + Auth Service.

---

## 📦 Installation

```bash
npm install @spidy092/auth-client
```

> **Note:** This package supports both **ES Modules (`import`)** and **CommonJS (`require`)**.
> 
> **CommonJS Usage:**
> ```js
> const { auth } = require('auth-client');
> const api = require('auth-client/api').default; // Note: .default is required for api
> const { decodeToken } = require('auth-client/utils/jwt');
> ```

---

## 🔧 Setup

```js
import { auth } from 'auth-client';

auth.setConfig({
  clientKey: 'admin-ui',
  authBaseUrl: 'http://auth.localhost:4000/auth',
});
```

---

## 🚀 Usage

### Login
```js
auth.login();
```

### Handle Callback
```js
auth.handleCallback(); // Call this on /callback page
```

### Logout
```js
auth.logout();
```

### Get Token
```js
const token = auth.getToken();
```

---

## 🧠 React Integration

### Provider
```jsx
import { AuthProvider } from 'auth-client/react/AuthProvider';

<AuthProvider>
  <App />
</AuthProvider>
```

### Hook
```jsx
import { useAuth } from 'auth-client/react/useAuth';

const { user, token, login, logout } = useAuth();
```

---

## 📡 Authenticated API
```js
import api from 'auth-client/api';

api.get('/me'); // sends Authorization header
```

---

## 🧪 Utilities
```js
import { decodeToken, isTokenExpired } from 'auth-client/utils/jwt';
```

---

## ✅ Built-in Features
- Token handling (in-memory + localStorage)
- CSRF-safe login with state param
- Auto API auth header via Axios
- React support via context and hooks

---

## 🔐 Security
- No HttpOnly cookies — safe from XSS if you sandbox `localStorage`
- Handles CSRF via `state`
- Designed for refresh via backend `/refresh`

---

## 📦 To Publish Locally
```bash
npm pack
npm install ../auth-client-1.0.0.tgz
```

---

## 🏁 License
MIT
npm package: @spidy88/lint-staged-tsc
Description: A tool that runs tsc-files on staged files but ignores errors in non-staged files
Author: Nick Ferraro
Latest version: 1.0.0

# Lint Staged TSC

A wrapper CLI around tsc-files that allows us to filter compilation output for staged files only

## Get started

Install peer depedencies
```
npm i -D typescript lint-staged tsc-files
```

Install this package

```
npm i -D @spidy88/lint-staged-tsc
```

Follow the instructions for [lint-staged](https://www.npmjs.com/package/lint-staged) to invoke `lint-staged-tsc` on your staged files. Here's an example from the package.json:
```
"lint-staged": {
  "*.{ts,tsx}": [
    "lint-staged-tsc --noEmit --strict"
  ]
}
```
## How it works

All parameters are forwarded to tsc-files. We then do a simple parse of the tsc-files output and
ignore any output not related to a staged file. It's a very primitive attempt and there are likely
many edge cases not taken into consideration but it should work for simple needs

## Why

We found ourselves needing to update our Typescript config but this resulted in hundreds of errors
across hundreds of files. In order to maintain velocity on product features, we only wanted to 
enforce the new rules across any files that get updated. Thus applying new rules to staged files
and ignoring all other files which will most definitely still have errors until we can address them.