open-index/open-npm huggingface dataset:
npm package: @supersurkhet/cli
Description: CLI for Supersurkhet plugin development.
Latest version: 0.0.1

# @supersurkhet/cli

CLI for Supersurkhet plugin development.

## Commands

- `supersurkhet new <name>`: scaffold a new plugin project
- `supersurkhet types --config <file> --out <file>`: generate TS row types from schema docs
- `supersurkhet link --project <id> --endpoint <url> --token <token>`: connect local dir to remote project
- `supersurkhet token issue --name <name>`: issue a new CLI token for the current user/project
- `supersurkhet token list`: list CLI tokens for the current user/project
- `supersurkhet token rotate --token-id <id> [--name <name>]`: rotate an existing CLI token
- `supersurkhet token revoke --token-id <id>`: revoke an existing CLI token
- `supersurkhet sync-up --config <file>`: push schema docs to the linked remote project
- `supersurkhet sync-down --config <file> --out <file>`: pull latest schema docs from the linked remote project

## Install

```bash
npm i -D @supersurkhet/cli @supersurkhet/sdk
```

## Auth

Token resolution order:

1. `--token`
2. `SUPERSURKHET_TOKEN` env var
3. `~/.supersurkhet/credentials.json` (saved by `link`)

## Use

```bash
npx supersurkhet --help
```
npm package: @supersurkhet/sdk
Description: ## Developer experience (today)
Latest version: 0.0.1

# @supersurkhet/sdk

## Developer experience (today)

This is the current flow (without auth/project selection yet):

1. Scaffold a project:

```bash
supersurkhet new my-plugin
cd my-plugin
```

2. Define schema docs in `supersurkhet.config.mjs`.

3. Generate local TS types from schema docs:

```bash
supersurkhet types --config supersurkhet.config.mjs --out supersurkhet/schema.types.ts
```

4. Link your local directory to a remote project:

```bash
supersurkhet link --project <project-id> --endpoint <api-url> --token <api-token>
```

5. Push local schema snapshot to remote project:

```bash
supersurkhet sync-up --config supersurkhet.config.mjs
```

6. Pull latest snapshot back down:

```bash
supersurkhet sync-down --config supersurkhet.config.mjs --out supersurkhet/schema.synced.json
```

---

## SDK authoring APIs

### Define actions + plugin

```ts
import { createActionRegistry, definePlugin, defineSchemaDoc } from '@supersurkhet/sdk';

const actions = createActionRegistry().defineAction({
  id: 'product.create',
  handler: async (input: { name: string }) => ({ ok: true, input }),
});

const productSchema = defineSchemaDoc({
  schemaId: 'product',
  fields: [
    {
      key: 'name',
      type: 'string',
      dataType: 'string',
      fieldType: 'string',
    },
    {
      key: 'price',
      type: 'number',
      dataType: 'number',
      fieldType: 'currency',
    },
  ],
});

export default definePlugin({
  pluginId: 'my.plugin',
  version: '0.0.1',
  actions,
  schemaDocs: [productSchema],
});
```

### Zod schema conversion (SDK-patched Zod)

```ts
import { defineZodSchemaDoc } from '@supersurkhet/sdk';

const schema = defineZodSchemaDoc({
  schemaId: 'product',
  schema: ({ z }) =>
    z
      .object({
        name: z.string(),
        price: z.number().min(0),
      })
      .withDerivation('isPremium', z.boolean()),
});
```

### Realtime-ready schema sync store

```ts
import { createSchemaSyncStore } from '@supersurkhet/sdk';

const store = createSchemaSyncStore();
store.subscribe((envelope) => {
  console.log(envelope.source, envelope.operations);
});
store.upsert(mySchema, 'cli');
```
npm package: @superswap-ink/widget
Description: This guide walks you through the steps to embed the swap widget in your website in 2 minutes — whether your site is already a decentralized application (dApp) or not.
Latest version: 1.9.0

# Getting Started with the Widget

This guide walks you through the steps to embed the swap widget in your website in 2 minutes — whether your site is already a decentralized application (dApp) or not.

With the swap widget, your users can swap your token or any ink ERC-20 tokens on Superswap without leaving your site!

## Installing the Widgets Library

To get started, install the widgets library using npm or Yarn.

```
npm install --save @superswap-ink/widget
```

## Adding the Widget to Your App

Next, embed the React component in your application.

```
import { SwapWidget } from '@superswap-ink/widget'
import '@superswap-ink/widget/dist/style.css'

function App() {
  <div>
    <SwapWidget />
  </div>
}
```

## Customizing the Widget

You can set optional parameters to tailor the appearance and functionality of the widget to fit your dApp.

| Param         | Type      | Default   |
| ------------- | --------- | --------- |
| `width`       | number    | 480       |
| `inputToken`  | string    | NATIVE    |
| `outputToken` | string    | undefiend |
| `amount`      | string    | undefiend |
| `darkMode`    | bool      | undefined |
| `slippage`    | number    | 0.5       |
| `hideBridge`  | bool      | undefined |



```
import { SwapWidget } from '@superswap-ink/widget'
import '@superswap-ink/widget/dist/style.css'

function App() {
  <div>
    <SwapWidget
      width={500}
      inputToken={"NATIVE"}
      outputToken={"0xD642B49d10cc6e1BC1c6945725667c35e0875f22"}
      amount={"100"}
      slippage={10}
      darkMode={true}
    />
  </div>
}
```