open-index/open-npm huggingface dataset:
npm package: @solana-developers/node-helpers
Description: Solana helper functions for node.js
Author: Mike MacCana
Latest version: 1.2.2
Deprecated: This package has been renamed! Please use @solana-developers/helpers instead.

# Solana node helpers

The `node-helpers` package package contains node.js specific Solana helper functions.

See `@solana/web3.js` for functions that work in both the browser and node.js.

## Installation

```bash
npm i @solana-developers/node-helpers
```

## getKeypairFromFile()

Gets a keypair from a file - the format must be the same as [Solana CLI](https://docs.solana.com/wallet-guide/file-system-wallet) uses, ie, a JSON array of numbers:

To load the default keypair `~/.config/solana/id.json`, just run:

```typescript
const keyPair = await getKeypairFromFile();
```

or to load a specific file:

```typescript
const keyPair = await getKeypairFromFile("somefile.json");
```

or using home dir expansion:

```typescript
const keyPair = await getKeypairFromFile("~/code/solana/demos/steve.json");
```

## getKeypairFromEnvironment()

Gets a keypair from a secret key stored in an environment variable. This is typically used to load secret keys from [env files](https://stackoverflow.com/questions/68267862/what-is-an-env-or-dotenv-file-exactly).

```typescript
const keyPair = await getKeypairFromEnvironment("SECRET_KEY");
```

## addKeypairToEnvFile()

Saves a keypair to the environment file.

```typescript
await addKeypairToEnvFile(testKeypair, "SECRET_KEY");
```

or to specify a file name:

```typescript
await addKeypairToEnvFile(testKeypair, "SECRET_KEY", ".env.local");
```

This will also reload the env file

### Secret key format

Secret keys can be read in either the more compact base58 format (`base58.encode(randomKeypair.secretKey);`), like:

```
# A random secret key for demo purposes
SECRET_KEY=QqKYBnj5mcgUsS4vrCeyMczbTyV1SMrr7SjSAPj7JGFtxfrgD8AWU8NciwHNCbmkscbvj4HdeEen42GDBSHCj1N
```

Or the longer, 'array of numbers' format `JSON.stringify(Object.values(randomKeypair.secretKey));`:

```
# A random secret key for demo purposes
SECRET_KEY=[112,222,91,246,55,109,221,4,23,148,251,127,212,180,44,249,182,139,18,13,209,208,6,7,193,210,186,249,148,237,237,1,70,118,1,153,238,134,239,75,187,96,101,138,147,130,181,71,22,82,44,217,194,122,59,208,134,119,98,53,136,108,44,105]
```

We always save keys using the 'array of numbers' format, since most other Solana apps (like the CLI SDK and Rust tools) use the 'array of numbers' format.

## Development

To run tests

```
npm run test
```

The tests use the [node native test runner](https://blog.logrocket.com/exploring-node-js-native-test-runner/).
npm package: @solana-developers/preset-anchor
Description: This library is a preset for create-solana-dapp that adds anchor support to your project.
Latest version: 3.1.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @solana-developers/preset-anchor

This library is a preset for [create-solana-dapp](https://npm.im/create-solana-dapp) that adds
[Anchor](https://www.anchor-lang.com/) support to your project.

## Supported generators

### anchor-application

```bash
NX   generate @solana-developers/preset-anchor:anchor-application [name] [options,...]

From:  @solana-developers/preset-anchor (v0.0.1)
Name:  anchor-application (aliases: application, preset)

  Generate an Anchor application

Options:
    --name           Name of the project                               [string]
    --programName    Name of the program                               [string]
    --template       The template to use          [string] [choices: "counter",
                                                     "basic", "none"] [default:
                                                                        "none"]
    --skipFormat     Skip formatting files                            [boolean]
```

### anchor-template

```bash
NX   generate @solana-developers/preset-anchor:anchor-template [name] [options,...]

From:  @solana-developers/preset-anchor (v0.0.1)
Name:  anchor-template (aliases: template)

  Generate an Anchor template

Options:
    --directory                                                        [string]
    --name                                                             [string]
    --projectName          Name of the project                         [string]
    --template             The template to use       [string] [choices: "base",
                                                            "counter", "basic"]
    --skipUpdateIndexTs    Skip updating index.ts                     [boolean]
```

## More information

- [GitHub repository](https://github.com/solana-developers/create-solana-dapp)
- [npm package](https://npm.im/create-solana-dapp)
- [StackOverflow](https://solana.stackexchange.com/questions/tagged/create-solana-dapp)
npm package: @solana-developers/preset-common
Description: This library is a preset for create-solana-dapp with shared code for the other presets.
Latest version: 3.1.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @solana-developers/preset-common

This library is a preset for [create-solana-dapp](https://npm.im/create-solana-dapp) with shared code for the other
presets.

## Supported generators

### common-template

```bash
NX   generate @solana-developers/preset-common:common-template [name] [options,...]

From:  @solana-developers/preset-common (v0.0.1)
Name:  common-template

  Generate Common templates

Options:
    --directory                                                        [string]
    --name                                                             [string]
    --npmScope         The npm scope to use                            [string]
    --template         The template to use                   [string] [choices:
                                                           "license", "readme"]
    --webName          Name of the web application                     [string]
                       (overrides name)
    --anchor           Anchor template to use        [string] [choices: "none",
                                                            "counter", "basic"]
                                                              [default: "none"]
    --anchorName       Anchor project name         [string] [default: "anchor"]
    --anchorProgram    Anchor program name                             [string]
    --licenseAuthor    The author to use in the                        [string]
                       license
    --preset           The preset to use             [string] [choices: "next",
                                                                       "react"]
```

## More information

- [GitHub repository](https://github.com/solana-developers/create-solana-dapp)
- [npm package](https://npm.im/create-solana-dapp)
- [StackOverflow](https://solana.stackexchange.com/questions/tagged/create-solana-dapp)
npm package: @solana-developers/preset-next
Description: This library is a preset for create-solana-dapp that adds next.js support to your project.
Latest version: 3.1.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @solana-developers/preset-next

This library is a preset for [create-solana-dapp](https://npm.im/create-solana-dapp) that adds
[Next.js](https://nextjs.org/) support to your project.

## Supported generators

### next-application

```bash
NX   generate @solana-developers/preset-next:next-application [name] [options,...]

From:  @solana-developers/preset-next (v0.0.1)
Name:  next-application (aliases: application, preset)

  Generate a Next.js application

Options:
    --name             Name of the application                         [string]
    --anchor           Anchor template to use        [string] [choices: "none",
                                                            "counter", "basic"]
                                                           [default: "counter"]
    --anchorName       Anchor project name         [string] [default: "anchor"]
    --anchorProgram    Anchor program name                             [string]
    --port             Port to run the application     [number] [default: 3000]
                       on
    --ui               The UI library to use         [string] [choices: "none",
                                                          "tailwind"] [default:
                                                                    "tailwind"]
    --webName          Name of the web application                     [string]
                       (overrides name)
    --skipFormat       Skip formatting files                          [boolean]
```

### next-template

```bash
NX   generate @solana-developers/preset-next:next-template [name] [options,...]

From:  @solana-developers/preset-next (v0.0.1)
Name:  next-template (aliases: template)

  Generate a Next.js template

Options:
    --directory                                                        [string]
    --name                                                             [string]
    --npmScope         The npm scope to use                            [string]
    --template         The template to use           [string] [choices: "base",
                                                            "none", "tailwind"]
    --webName          Name of the web application                     [string]
                       (overrides name)
    --anchor           Anchor template to use        [string] [choices: "none",
                                                            "counter", "basic"]
                                                              [default: "none"]
    --anchorName       Anchor project name         [string] [default: "anchor"]
    --anchorProgram    Anchor program name                             [string]
```

## More information

- [GitHub repository](https://github.com/solana-developers/create-solana-dapp)
- [npm package](https://npm.im/create-solana-dapp)
- [StackOverflow](https://solana.stackexchange.com/questions/tagged/create-solana-dapp)
npm package: @solana-mobile/mobile-wallet-adapter-expo-bottom-sheet
Description: Config plugin to add a Mobile Wallet Adapter bottom sheet Activity to an Expo app
Author: Michael Sulistio
Latest version: 0.2.1

# Mobile Wallet Adapter Bottom Sheet

## What is it?

An [Expo Config Plugin](https://docs.expo.dev/config-plugins/introduction/) for by Expo Solana wallets to inject a bottom sheet themed Android Activity to handle
Mobile Wallet Adapter requests. Wallets can designate a React component to render as UI for the injected activity.

## Usage

### Install the plugin

```
npm install <TODO: Publish npm package>
```

### Configure the plugin

Configure the plugin in your app.json.

Optionally, specify a `walletUriBase` to register your wallet's custom mwa scheme to handle intents.

```
{
  "expo": {
    "name": "myApp",
    "plugins": [
      [
        "mwa-bottom-sheet-expo-plugin",
        {
          "walletUriBase": "my-custom-mwa-scheme"
        }
      ]
    ]
  }
}
```

### Register the bottom sheet activity

The config plugin injects an Android activity into your expo build, but you'll need to register
the injected Activity on the Javascript side.

#### Create a custom app entrypoint

Copy over `node_modules/expo/AppEntry.js` to a new file (`CustomAppEntry.js`) and just add the `AppRegistry.registerComponent` call.

```js
// CustomAppEntry.js
import registerRootComponent from "expo/build/launch/registerRootComponent";
import { AppRegistry } from "react-native";

import App from "./App";
import YourMWABottomSheetComponent from "./YourMWABottomSheetComponent";

// Add this to associate the activity -> React Component
AppRegistry.registerComponent(
  "MobileWalletAdapterEntrypoint",
  () => YourMWABottomSheetComponent
);

registerRootComponent(App);
```

#### Reroute main entrypoint to CustomAppEntry.js

In `package.json`, redirect `"main"` to point at the custom entrypoint file.

```
{
  "name": "your-expo-app",
  "main": "./CustomAppEntry.js",
}
```

### Prebuild

Now the config plugin is configured and will be included in the expo prebuild step of `eas build`!
npm package: @solana-mobile/solana-mobile-dapp-scaffold
Description: A quickstart React Native template for a Solana Mobile dApp with polyfills and dependencies installed
Author: Michael Sulistio
Latest version: 0.0.1

# Solana Mobile dApp Scaffold

A ready-to-go template Solana React Native dApp with dependencies installed and basic React UI components.
It provides an interface to connect to locally installed wallet apps (that are MWA-compatible), view your account balance on devnet, and request an airdrop of SOL.

This React Native dApp is only fully functional on Android.

## Featured Libarires
- [Mobile Wallet Adapter](https://github.com/solana-mobile/mobile-wallet-adapter/tree/main/js/packages/mobile-wallet-adapter-protocol) for connecting to wallets and signing transactions/messages
- [web3.js](https://solana-labs.github.io/solana-web3.js/) for constructing transactions and an RPC `connection` client.

<table>
  <tr>
    <td align="center">
      <img src="https://github.com/solana-mobile/solana-mobile-dapp-scaffold/assets/18451967/3d83d3dc-ab65-4a2c-881d-8a229f34e392" alt="Scaffold dApp Screenshot 1" width=300 />
    </td>
    <td align="center">
      <img src="https://github.com/solana-mobile/solana-mobile-dapp-scaffold/assets/18451967/c6bebd4c-2bf0-4519-8d60-44c7b0d365d0" alt="Scaffold dApp Screenshot 2" width=300 />
    </td>
    <td align="center">
      <img src="https://github.com/solana-mobile/solana-mobile-dapp-scaffold/assets/18451967/eda431f5-1b95-41bc-a4db-6974a339717d" alt="Scaffold dApp Screenshot 3" width=300 />
    </td>
  </tr>
</table>

## Prerequisites

If you haven't setup a React Native development environment for Android, you'll need to do that first. Follow the [Prerequisite Setup Guide](https://docs.solanamobile.com/getting-started/development-setup).

Follow the guide to make sure you:
- setup your Android and React Native development environment.
- have an Android device or emulator.
- install an MWA compliant wallet app on your device/emulator.
   
## Usage
1. Initialize project template
```
npx react-native init MySolanaDapp --template https://github.com/solana-mobile/solana-mobile-dapp-scaffold.git
cd MySolanaDapp
```
2. Install dependencies
- `yarn install` or `npm install`
3. Launch the app on your Android device/emulator
- `npx react-native run-android`

## Troubleshooting
  
- `TypeError: cli.init is not a function`: This during template initialization means you have an old version of React Native CLI.
This template only works with the new CLI. You can uninstall and reinstall it as directed [here](https://stackoverflow.com/questions/72768245/typeerror-cli-init-is-not-a-function-for-react-native).

- `Looks like your iOS environment is not properly set`: You can ignore this during template initialization and build the Android app as normal. This template is only compatible with Android.
npm package: @solana-name-service/sns-sdk-kit
Description: <p align="center"> <img width="250" src="https://v2.sns.id/assets/logo/brand.svg"/> </p>
Latest version: 0.9.5-beta

<p align="center">
<img width="250" src="https://v2.sns.id/assets/logo/brand.svg"/>
</p>

# SNS JS-KIT SDK

![npm version](https://img.shields.io/npm/v/@solana-name-service/sns-sdk-kit)
![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=flat&logo=typescript&logoColor=white)
![License](https://img.shields.io/github/license/bonfida/sns-sdk)

The JS-KIT SDK is a JavaScript toolkit for managing .sol domains and records. Built on `@solana/kit` (formerly `@solana/web3.js` 2.x), it simplifies development and ensures secure and efficient functionality.

**Note: This SDK is currently in beta and subject to changes. Features, APIs, and functionality may evolve as development progresses.**

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Example Usage](#example-usage)
- [Documentation](#documentation)
- [License](#license)

## Features

- Domain resolution and primary domain lookup
- Domain/Subdomain Management
- Record Handling

## Installation

```bash
npm install @solana-name-service/sns-sdk-kit@beta @solana/kit
```

```
yarn add @solana-name-service/sns-sdk-kit@beta @solana/kit
```

## Example Usage

```typescript
import {
  Record,
  getDomainRecord,
  getPrimaryDomain,
  resolveDomain,
} from "@solana-name-service/sns-sdk-kit";
import {
  Address,
  createDefaultRpcTransport,
  createSolanaRpcFromTransport,
} from "@solana/kit";

(async () => {
  // Initialize rpc interface
  const transport = createDefaultRpcTransport({
    url: YOUR_RPC_URL,
  });
  const rpc = createSolanaRpcFromTransport(transport);

  // Resolve .sol domain
  const resolved = await resolveDomain({ rpc, domain: "sns.sol" });

  // Get domain records
  const records = await getDomainRecord({
    rpc,
    domain: "sns.sol",
    record: Record.Url,
    options: {
      deserialize: true,
    },
  });

  // Get primary domain for address
  const primaryDomain = await getPrimaryDomain({
    rpc,
    walletAddress: "36Dn3RWhB8x4c83W6ebQ2C2eH9sh5bQX2nMdkP2cWaA4" as Address,
  });

  console.log({ resolved, records, primaryDomain });
})();
```

## Documentation

The documentation for the JS-KIT SDK is currently a work-in-progress. Stay tuned for updates!

## License

This project is licensed under the MIT License. See the LICENSE file for more details.
npm package: @solana-nft-programs/rewards-center
Description: Rewards center
Latest version: 1.0.0

# Rewards-center

<p align="center">
    A rewards center for NFTs and FTs on Solana
</p>

# Background

Rewards center is a modular smart contract for staking tokens and distributing various rewards.

# Getting Started

While the deployments of this program are not live, you can deploy your own by using these steps. This will first clone the repo then run `make keys` will generate a new keypair for your program and update authority. NOTE: You must not lose these keypairs. Substitute your own keypair in if you would like to use your own.

> Note: You must not lose the keypairs! They will be saved in ./keypairs directory. To use your own keypairs place them there and skip the `make keys` step

```bash
git clone https://github.com/solana_nft_programs/rewards-center.git
make keys
make key-replace
make install
make build
solana airdrop 2 --url devnet keypairs/update-authority.json
solana program deploy --url devnet --keypair ./keypairs/update-authority.json --program-id ./keypairs/program-id.json ./target/deploy/solana_nft_programs_reward_center.so
```
# State map

<div style="text-align: center; width: 100%;">
  <img style="width: 100%" src="./doc-assets/diagram.png" />
</div>