open-index/open-npm huggingface dataset:
npm package: @scryhub/protocol
Description: TypeScript types and RPC message contracts for ScryHub core to communicate with LGSLibrary extensions.
Latest version: 0.2.0

# @scryhub/protocol

Defines the RPC protocol for the **ScryHub** Chrome extension to communicate with extensions that implement an **LGSLibrary** (Local Game Store Library).

This package exports the TypeScript types and message contracts that both Core and Library extensions use to talk to each other.

See [ScryHub](https://github.com/AnEmortalKid/scryhub) for more details about the overall project.


---

## Install

```bash
npm install @scryhub/protocol
```

## Example Usage

In your extension's background/service worker

```typescript
import type { CardLookupDescriptor, CardLookupResp } from "@scryhub/protocol";

chrome.runtime.onMessageExternal.addListener((msg, _sender, sendResponse) => {
  if (msg?.type === "scryhub.library.lookupCard") {
    const descriptor: CardLookupDescriptor = msg.descriptor;
    // …do lookup work…
    const resp: CardLookupResp = {
      storeKey: "my-store",
      found: true,
      cards: [{ title: "Example", url: "https://…" }]
    };
    sendResponse(resp);
  }
});
```

## Intended Audience

* **ScryHub Core** uses this package to validate messages and version checks
* **LGSLibrary Authors** use this package to implement the correct message types and response shapes


## License

MIT
npm package: @scrypt-inc/bsv
Description: A pure and powerful JavaScript Bitcoin SV (BSV) library.
Author: sCrypt.Inc
Latest version: 1.0.5

bsv
===

Javascript Bitcoin SV library.

Documentation is available on the [Money Button Documentation Page](https://docs.moneybutton.com/docs/bsv-overview.html).

Changelog
---------
**1.5.0**
* Add build files into repo.

**1.4.0**
* Change default fee to 0.5 sat/byte

**1.3.0**
* Remove limit on OP_RETURN size

**1.1.0**
* Refactor code related to buffers and get rid of bufferUtil
* Deprecate p2sh
* Add .Mnemonic to bsv object

**1.0.0**
* Bump to 1.0 release as per the suggestion of @mathiasrw

**0.30.2**
* Added addSafeData to Transaction.

**0.30.1**
* Enforce buffer check for Electrum ECIES decryption.
* Clean up script folder (no API breaking changes).
* Documentation improvements.

**0.30.0**
* Fix transaction size calculation.

**0.29.2**
* Throw error on invalid hex strings in script

**0.29.1**
* Add support for new OP_RETURN style: buildSafeDataOut and isSafeDataOut (and getData)

**0.27.2**
* Add support for Stress Test Network (STN).

**v0.27.1**
* Replace lodash methods with inline pure javascript methods.

**v0.27.0**
* Remove version guard. This should fix the "two versions of bsv" error that
  people often get. Note that it is poor practice to use incompatible versions
  of bsv. To send objects from one version of the library to another, always
  serialize to a string or buffer first. Do not send objects from one version to
  another. This due to frequent use of "instanceof" inside the library.

**v0.26.5**
* lodash optimization and overall size optimization of bsv.min.js
* fix isFinal
* fix non-dust amount example
* minor ECIES API issue

**v0.26.4**
* Use ECDSA.signWithCalcI(...) convenience method inside Message.

**v0.26.3**
* Add ECDSA.signWithCalcI(...) convenience method.

**v0.26.2**
* Add Mnemonic.fromString(string).
* Add convenience method for ECDSA.signRandomK (mostly for demo purposes).
* Add convenience methods Message.sign and message.verify.
* Move large portions of the documentation to [docs.moneybutton.com](https://docs.moneybutton.com).

**v0.26.1**
* Add .fromRandom() method for Mnemonic.

**v0.26.0**
* Remove the (already deprecated) .derive() method from HDPrivateKey and HDPublicKey. If you rely on this, please switch to .deriveNonCompliantChild(). If you do not already rely on this, you should use .deriveChild() instead.
* Move large portions of the documentation to [docs.moneybutton.com](https://docs.moneybutton.com).
* HDPrivateKey / HDPublicKey toHex() and fromHex()
* HDPrivateKey.fromRandom()
* Remove Base32 (this was only used for cashaddr and is now obsolete).

**v0.25.0**
* Remove support for cashaddr completely. This saves size in the bundle.
* Private key .toString() method now returns WIF, which makes it compatible with the corresponding .fromString(wif) method.
* Private key and public key classes now have toHex() and fromHex(hex) methods.
* Move large portions of the documentation to [docs.moneybutton.com](https://docs.moneybutton.com).
npm package: @scrypt-inc/cat-token
Description: A demo sCrypt smart contract.
Latest version: 0.2.10

# sCrypt Cat Token

## Build

```sh
npm run build
```

## Testing Locally

```sh
npm run test
```

## Testnet Sample Transactions

- A transaction with 3 token UTXO inputs and 1 token UTXO output, with a virtual size (vsize) of 6.2k. The transaction ID (txid) is [918ce5eb57aea8ee0ccd9c4815610385247d42f9cff06f086ed6d9e936992783](https://mempool-testnet.fractalbitcoin.io/tx/918ce5eb57aea8ee0ccd9c4815610385247d42f9cff06f086ed6d9e936992783).

- A transaction with 1 token UTXO input and 2 token UTXO outputs, with a virtual size (vsize) of 2.9k. The transaction ID (txid) is [ec1b80405b8b2027a1143a836375657843f53b1873832afe9c005b9cf5859479](https://mempool-testnet.fractalbitcoin.io/tx/ec1b80405b8b2027a1143a836375657843f53b1873832afe9c005b9cf5859479).

## Cat Token Transaction Limits

For a Cat Token protocol transaction, the maximum number of inputs is 6, and the maximum number of outputs is also 6.

Since we need to calculate the txid of the previous transaction, we must ensure that the number of bytes in the previous transaction’s data is less than 520.

This is because the maximum byte limit for an element on the Bitcoin Virtual Machine (BVM) stack is [520](https://github.com/bitcoin/bitcoin/blob/master/src/script/script.h#L27). The corresponding variable name is `MAX_SCRIPT_ELEMENT_SIZE`.

## Cat Token Protocol

![](static/cat-token-protocol.svg)
npm package: @scrypt-inc/ecpair
Description: Client-side Bitcoin JavaScript library ECPair
Latest version: 3.0.5

# ecpair
[![Github CI](https://github.com/sCrypt-Inc/ecpair/actions/workflows/main_ci.yml/badge.svg)](https://github.com/sCrypt-Inc/ecpair/actions/workflows/main_ci.yml) [![NPM](https://img.shields.io/npm/v/ecpair.svg)](https://www.npmjs.org/package/ecpair) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

A library for managing SECP256k1 keypairs written in TypeScript with transpiled JavaScript committed to git.

**Note** `ECPair`.makeRandom() uses the `crypto.getRandomValues` if there is no custom `rng` function provided. This API currently is still an experimental feature as of Node.js 18.19.0. To work around this you can do one of the following:
1. Use a polyfill for crypto.getRandomValues()
2. Use the `--experimental-global-webcrypto` flag when running node.js.
3. Pass in a custom rng function to generate random values.

## Example

TypeScript

``` typescript
import { Signer, SignerAsync, ECPairInterface, ECPairFactory, ECPairAPI, TinySecp256k1Interface } from '@scrypt-inc/ecpair';
import * as crypto from 'crypto';

// You need to provide the ECC library. The ECC library must implement 
// all the methods of the `TinySecp256k1Interface` interface.
const tinysecp: TinySecp256k1Interface = require('tiny-secp256k1');
const ECPair: ECPairAPI = ECPairFactory(tinysecp);

// You don't need to explicitly write ECPairInterface, but just to show
// that the keyPair implements the interface this example includes it.

// From WIF
const keyPair1: ECPairInterface = ECPair.fromWIF('KynD8ZKdViVo5W82oyxvE18BbG6nZPVQ8Td8hYbwU94RmyUALUik');
// Random private key
const keyPair2 = ECPair.fromPrivateKey(crypto.randomBytes(32));
// OR (uses randombytes library, compatible with browser)
const keyPair3 = ECPair.makeRandom();
// OR use your own custom random buffer generator BE CAREFUL!!!!
const customRandomBufferFunc = (size: number): Buffer => crypto.randomBytes(size);
const keyPair4 = ECPair.makeRandom({ rng: customRandomBufferFunc });
// From pubkey (33 or 65 byte DER format public key)
const keyPair5 = ECPair.fromPublicKey(keyPair1.publicKey);

// Pass a custom network
const network = {}; // Your custom network object here
ECPair.makeRandom({ network });
ECPair.fromPrivateKey(crypto.randomBytes(32), { network });
ECPair.fromPublicKey(keyPair1.publicKey, { network });
// fromWIF will check the WIF version against the network you pass in
// pass in multiple networks if you are not sure
ECPair.fromWIF('wif key...', network);
const network2 = {}; // Your custom network object here
const network3 = {}; // Your custom network object here
ECPair.fromWIF('wif key...', [network, network2, network3]);
```

## LICENSE [MIT](LICENSE)
Written and tested by [bitcoinjs-lib](https://github.com/sCrypt-Inc/bitcoinjs-lib) contributors since 2014.
npm package: @scrypta/core
Description: Scrypta Javascript Library for build Blockchain enabled applications.
Author: Scrypta
Latest version: 3.0.7

# Scrypta-Core NPM

<p><a href="https://camo.githubusercontent.com/4e892209b4b1e2d1a773ec97e544a92f068a6f0b/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f333136382f312a31674778414b57714b5135577a635170755f766932412e6a706567" target="_blank" rel="noopener noreferrer"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://camo.githubusercontent.com/4e892209b4b1e2d1a773ec97e544a92f068a6f0b/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f333136382f312a31674778414b57714b5135577a635170755f766932412e6a706567" alt="" data-canonical-src="https://miro.medium.com/max/3168/1*1gGxAKWqKQ5WzcQpu_vi2A.jpeg" /></a></p>
<h2 style="text-align: center;"><a id="user-content-scrypta-identity-framework" class="anchor" href="https://github.com/scryptachain/scrypta-identity-framework/new/master?readme=1#scrypta-identity-framework" aria-hidden="true"></a><strong>Scrypta Core</strong></h2>
<p style="text-align: center;">JS implementation of main wallet features.</p>
<p style="text-align: center;"><a title="English &mdash; Scrypta Wiki" href="https://en.scrypta.wiki/core/" target="_blank" rel="nofollow noopener"><strong>Wiki English</strong></a>&nbsp;&middot; &middot; &middot;&nbsp;<a title="Italiano &mdash; Scrypta Wiki" href="https://it.scrypta.wiki/core/" target="_blank" rel="nofollow noopener"><strong>Wiki italiano</strong></a></p>

<br>This is the main client side library of Scrypta Blockchain, written in NodeJS.

You can use this version by installing it directly from npm:

```npm install --save @scrypta/core```

# Use your own IdaNodes

To override the IdaNodes list you've to rewrite the array like this:

```
let ScryptaCore = require('@scrypta/core')
let scrypta = new ScryptaCore
scrypta.staticnodes = true
scrypta.mainnetIdaNodes = ['http://localhost:3001', 'https://anotheridanode.com']
```

# Scrypta-Core CLI (WIP)

If you want to use the module as a CLI you have to run:

```sudo npm link```

Then you'll be able to run commands like:
```scrypta getinfo```

This feature is a work in progress and will be released soon.