open-index/open-npm huggingface dataset:
npm package: @shadowpay/core
Description: Core cryptographic utilities for ShadowPay SDK
Author: ShadowPay Team
Latest version: 0.1.1

# @shadowpay/core

Core cryptographic utilities for the ShadowPay SDK. Provides zero-knowledge proof primitives, ElGamal encryption, Poseidon hashing, and commitment generation for private payments on Solana.

## Installation

```bash
npm install @shadowpay/core
```

## Features

- **ElGamal Encryption** - Encrypt payment amounts on BN254 curve
- **Poseidon Hashing** - Generate cryptographic commitments and nullifiers
- **Commitment Generation** - Create sender and payment commitments
- **Field Element Operations** - Convert Solana addresses to BN254 field elements
- **Token Utilities** - Parse amounts for SOL, USDC, and USDT

## Usage

### ElGamal Encryption

```typescript
import { generateElGamalKeypair, encryptAmount } from '@shadowpay/core';

const keypair = generateElGamalKeypair();
const encrypted = encryptAmount(1000000n, keypair.publicKey);

console.log(encrypted.c1); // Ciphertext component 1
console.log(encrypted.c2); // Ciphertext component 2
```

### Generate Commitments

```typescript
import {
  generateRandomSecret,
  generateRandomSalt,
  computeSenderCommitment,
  computePaymentCommitment,
} from '@shadowpay/core';

const secret = generateRandomSecret();
const salt = generateRandomSalt();

const senderCommitment = await computeSenderCommitment(
  'YourWalletAddressHere',
  secret
);

const paymentCommitment = await computePaymentCommitment(
  senderCommitment,
  receiverCommitment,
  1000000n,
  'SOL',
  salt
);
```

### Token Utilities

```typescript
import { parseAmount, TOKENS } from '@shadowpay/core';

const lamports = parseAmount(0.001, 'SOL'); // 1000000
const usdcAmount = parseAmount(10, 'USDC'); // 10000000
```

## API Reference

### Encryption

- `generateElGamalKeypair()` - Generate ElGamal keypair
- `encryptAmount(amount, publicKey)` - Encrypt an amount

### Commitments

- `generateRandomSecret()` - Generate random secret (32 bytes)
- `generateRandomSalt()` - Generate random salt (32 bytes)
- `computeSenderCommitment(walletPubkey, secret)` - Generate sender commitment
- `computePaymentCommitment(sender, receiver, amount, token, salt)` - Generate payment commitment
- `computePaymentNullifier(secret, commitment)` - Generate nullifier
- `addressToFieldElement(address)` - Convert Solana address to field element

### Tokens

- `parseAmount(amount, token)` - Convert human-readable amount to lamports
- `TOKENS` - Token configuration (SOL, USDC, USDT)

## Constants

```typescript
export const API_URL = 'https://shadow.radr.fun';
export const CIRCUIT_URLS = {
  wasm: 'https://shadow.radr.fun/shadowpay/circuit-elgamal/...',
  zkey: 'https://shadow.radr.fun/shadowpay/circuit-elgamal/...',
  vkey: 'https://shadow.radr.fun/shadowpay/circuit-elgamal/...',
};
```

## License

MIT
npm package: @shadowsonata/nsw-ds-react
Description: An alternative version of NSW Design System React
Author: Darren Zhang
Latest version: 1.0.1

# NSW Design System React Library

This is adapted from the original [NSW Design System React Library](https://github.com/digitalnsw/nsw-design-system-react) but re-written in TypeScript and removed the global client side JavaScript.

## Install

```bash
npm install @shadowsonata/nsw-ds-react
```

Add the styles separately in your main app file entry:

```js
import "nsw-design-system/dist/css/main.css";
```

## Usage

Storybook coming soon... In the meantime you can use the storybook code in the repository.
Refer to individual components' usage in [Storybook](https://digitalnsw.github.io/nsw-design-system-react)

Here's how you import the component:

```tsx
import React from "react";

import { Callout } from "nsw-ds-react";

function Example() {
  return (
    <Callout title="Title of callout">
      <p>Description of callout</p>
    </Callout>
  );
}
```

## API Update

(Coming soon)

## License

MIT