# skeyn-sdk

> SDK for interacting the Solace Key Net

Latest version **1.0.0** (published 2023-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install skeyn-sdk
pnpm add skeyn-sdk
yarn add skeyn-sdk
bun add skeyn-sdk
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-10-10 |
| First published | 2023-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Solace Labs |
| Maintainers | ashwinxprasad |

## Links

- npm: https://www.npmjs.com/package/skeyn-sdk
- Repository: https://github.com/yourusername/your-sdk-name
- Homepage: https://github.com/yourusername/your-sdk-name#readme
- Issues: https://github.com/yourusername/your-sdk-name/issues
- npm.io page: https://npm.io/package/skeyn-sdk

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.21.1

## Recent versions

- 1.0.0 (latest) — 2023-10-10

## README

# Solace Keynet SDK

## Overview

Solace Keynet SDK is a JavaScript library designed to interact with Solace Keynet. It provides a set of functions to manage wallets, get nonces, signatures, public keys, and rulebooks, as well as store rules.

## Installation

```bash
npm install solace-keynet-sdk
```

## Functions

### `createWallet(createWalletData: CreateWalletData)`

Creates a new wallet.

#### Parameters

- `createWalletData`: Object
  - `namespace`: String
  - `walletAddr`: String
  - `signature`: String

### `getNonce(walletAddr: string)`

Gets the nonce for a given wallet address.

#### Parameters

- `walletAddr`: String

### `getSignature(txHash: string)`

Gets the signature for a given transaction hash.

#### Parameters

- `txHash`: String

### `getPubKey(walletAddr: string)`

Gets the public key for a given wallet address.

#### Parameters

- `walletAddr`: String

### `getRulebook(walletAddr: string)`

Gets the rulebook for a given wallet address.

#### Parameters

- `walletAddr`: String

### `storeRule(createRuleData: CreateACLData)`

Stores a rule.

#### Parameters

- `createRuleData`: Object
  - `walletAddr`: String
  - `signature`: String
  - `rule`: Object
    - `namespace`: String
    - `senderGroup`: Object
      - `addrs`: Array of Strings
      - `name`: String
    - `recipientAddr`: String
    - `tokenAddr`: String

## Types

### `CreateWalletData`

- `namespace`: String
- `walletAddr`: String
- `signature`: String

### `CreateACLData`

- `walletAddr`: String
- `signature`: String
- `rule`: Object
  - `namespace`: String
  - `senderGroup`: Object
    - `addrs`: Array of Strings
    - `name`: String
  - `recipientAddr`: String
  - `tokenAddr`: String

## Examples

### Create Wallet

```javascript
const { createWallet } = require("solace-keynet-sdk");

const data = {
  namespace: "myNamespace",
  walletAddr: "0x123...",
  signature: "0xabc...",
};

createWallet(data);
```

### Get Nonce

```javascript
const { getNonce } = require("solace-keynet-sdk");

const walletAddr = "0x123...";
getNonce(walletAddr);
```

## License

MIT

---
_Source: https://npm.io/package/skeyn-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
