open-index/open-npm huggingface dataset:
npm package: @j0nnyboi/prove-safecoin-wallet
Description: Prove ownership of a Solana wallet.
Author: Daniel Kelleher
Latest version: 0.2.5

# Prove-Solana-Wallet

This library proves ownership of a [Solana](https://solana.com) wallet to off-chain verifiers.

It is compatible with standard browser wallet adapters, such as 
[sol-wallet-adapter](https://github.com/project-serum/sol-wallet-adapter), 
and can be extended to others.

## Install

```sh
npm install @identity.com/prove-solana-wallet
```

or 

```sh
yarn add @identity.com/prove-solana-wallet
```

## Usage

Prove ownership of a keypair

Prover side: 
```js
const {prove} = require('@identity.com/prove-solana-wallet');
const proof = await prove(myKeypair);
```

Verifier side:
```js
const {verify} = require('@identity.com/prove-solana-wallet');
await verify(proof, expectedPublicKey);
```

Prove ownership of an external wallet (e.g. sol-wallet-adapter).
See [here](https://github.com/project-serum/sol-wallet-adapter) for more details.

Prover side:
```js
const {prove} = require('@identity.com/prove-solana-wallet');
import Wallet from "@project-serum/sol-wallet-adapter";

const providerUrl = 'https://www.sollet.io';
const wallet = new Wallet(providerUrl);
wallet.on('connect', async (publicKey) => {
  // once the wallet is connected, we can prove ownership
  const signer = (transaction:Transaction) => wallet.signTransaction(transaction);

  const proof = await prove(myKeypair);
});
```

Verifier side:
```js
const {verify} = require('@identity.com/prove-solana-wallet');
await verify(proof, expectedPublicKey);
```

## Details

The prove() function generates a zero-value transaction, and
signs it with the wallet private key. For the transaction to be verified
by the verify() function, it must:

- have ony one instruction: SystemProgram.transfer
- be zero-value
- be self-to-self (i.e the sender and recipient are the same)
- have a recent blockhash on mainnet
- but not be broadcast to mainnet

These measures increase the security by reducing the likelihood
that an attacker can either coerce the wallet owner to sign
a transaction or intercept a broadcast one.

## Configuration

The prove and verify functions can be configured as follows:

### `cluster`

Default: `mainnet-beta`

The cluster that should be used when generating and verifying proofs

### `commitment`

Default: `confirmed`

When checking that a proof transaction has not been transmitted, the commitment to be used, i.e. the degree to which the transaction is finalised by the network

### `supportedClusterUrls`

Optional
Default: empty

If the cluster is not a standard solana public cluster, this map provides
the cluster URL to connect to. Use this when the proof may contain a cluster that is
not recognised by solana's clusterApiUrl function.
npm package: @j0nnyboi/safe-rayz-react
Description: React hooks to fetch NFTs on Solana.
Author: NftEyez Team
Latest version: 0.10.2

# @nfteyez/sol-rayz-react

React hooks to fetch NFTs on Solana.

## Install

You need install `@solana/web3.js` in your project, since it is used as peer dependency.

```
npm i @solana/web3.js
npm i @nfteyez/sol-rayz-react

```

## How to use

`useWalletNfts` - returns parsed list of NFTs (SPL Tokens) for given wallet public address. Each item in array have all data specified on the blockchain. The NFT metadata stored separately, you need to pick `uri` property for each token and fetch data youself.

```javascript
import { useWalletNfts } from "@nfteyez/sol-rayz-react";
import type { Options } from "@nfteyez/sol-rayz";

const MyAwesomeGallery = () => {
  const { nfts, isLoading, error } = useWalletNfts({
    publicAddress: walletPublicKey,
    // pass your connection object to use specific RPC node
    connection,
  }: Options);

  if (error) return <div>Have some error</div>
  if (isLoading) return <div>Loading...</div>
  
  return (
    <div>Wallet have {nfts?.length} NFTs</div>
  ))
}

```

`Options` is the same type used used in `"@nfteyez/sol-rayz"` for `getParsedNftAccountsByOwner` method:

```javascript
// only `publicAddress` is required
export type Options = {
  /**
   * Wallet public address
   */
  publicAddress: StringPublicKey,
  /**
   * Optionally provide your own connection object.
   * Otherwise createConnectionConfig() will be used
   */
  connection?: Connection,
  /**
   * Remove possible rust's empty string symbols `\x00` from the values,
   * which is very common issue.
   * Default is true
   */
  sanitize?: boolean,
  /**
   * TODO: Add description within README and link here
   * Default is false - slow method
   * true - is fast method
   */
  strictNftStandard?: boolean,
  /**
   * Convert all PublicKey objects to string versions.
   * Default is true
   */
  stringifyPubKeys?: boolean,
  /**
   * Sort tokens by Update Authority (read by Collection)
   * Default is true
   */
  sort?: boolean,
};
```
npm package: @j0nnyboi/serum
Description: Library for interacting with the serum dex
Latest version: 0.1.1

[![npm (scoped)](https://img.shields.io/npm/v/@project-serum/serum)](https://www.npmjs.com/package/@project-serum/serum)
[![Build Status](https://travis-ci.com/project-serum/serum-js.svg?branch=master)](https://travis-ci.com/project-serum/serum-js)

# Serum JS Client Library

JavaScript client library for interacting with the Project Serum DEX.

## Installation

Using npm:

```
npm install @safecoin/web3.js @project-serum/serum
```

Using yarn:

```
yarn add @safecoin/web3.js @project-serum/serum
```

## Usage

```js
import { Account, Connection, PublicKey } from '@safecoin/web3.js';
import { Market } from '@project-serum/serum';

let connection = new Connection('https://testnet.solana.com');
let marketAddress = new PublicKey('...');
let programAddress = new PublicKey("...");
let market = await Market.load(connection, marketAddress, {}, programAddress);

// Fetching orderbooks
let bids = await market.loadBids(connection);
let asks = await market.loadAsks(connection);
// L2 orderbook data
for (let [price, size] of bids.getL2(20)) {
  console.log(price, size);
}
// Full orderbook data
for (let order of asks) {
  console.log(
    order.orderId,
    order.price,
    order.size,
    order.side, // 'buy' or 'sell'
  );
}

// Placing orders
let owner = new Account('...');
let payer = new PublicKey('...'); // safe-token account
await market.placeOrder(connection, {
  owner,
  payer,
  side: 'buy', // 'buy' or 'sell'
  price: 123.45,
  size: 17.0,
  orderType: 'limit', // 'limit', 'ioc', 'postOnly'
});

// Retrieving open orders by owner
let myOrders = await market.loadOrdersForOwner(connection, owner.publicKey);

// Cancelling orders
for (let order of myOrders) {
  await market.cancelOrder(connection, owner, order);
}

// Retrieving fills
for (let fill of await market.loadFills(connection)) {
  console.log(fill.orderId, fill.price, fill.size, fill.side);
}

// Settle funds
for (let openOrders of await market.findOpenOrdersAccountsForOwner(
  connection,
  owner.publicKey,
)) {
  if (openOrders.baseTokenFree > 0 || openOrders.quoteTokenFree > 0) {
    // safe-token accounts to which to send the proceeds from trades
    let baseTokenAccount = new PublicKey('...');
    let quoteTokenAccount = new PublicKey('...');

    await market.settleFunds(
      connection,
      owner,
      openOrders,
      baseTokenAccount,
      quoteTokenAccount,
    );
  }
}
```