open-index/open-npm huggingface dataset:
npm package: @quai/hardhat-deploy-metadata
Description: A Hardhat plugin that allows users to push contract metadata to IPFS.
Author: jonathan.quai
Latest version: 1.0.8

In hardhat.config.js: require("@quai/hardhat-deploy-metadata")

In hardhat deploy.js script:

const { deployMetadata } = require("hardhat")

const ipfsHash = await deployMetadata.pushMetadataToIPFS("ContractName");

const factory = new quais.ContractFactory(contract.abi, contract.bytecode, wallet, ipfsHash)
npm package: @quainetwork/quai-snap
Description: QuaiSnap
Latest version: 0.3.0-pre.7

# quai-snap

This is an **EXPERIMENTAL** snap for Quai Network.

## Running Locally

`yarn install`
`yarn build:clean && yarn serve`

Please refer to the index.html to see the available endpoints.

## Running Tests

`yarn test`
`yarn test:coverage`
npm package: @quais/abi
Description: Utilities and Classes for parsing, formatting and managing Ethereum ABIs.
Latest version: 0.1.0

Ethereum ABI Coder
==================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for encoding and decoding the Application Binary Interface (ABI)
used by most smart contracts to interoperate between other smart contracts and clients.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/abi/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    ConstructorFragment,
    EventFragment,
    Fragment,
    FunctionFragment,
    ParamType,
    FormatTypes,

    AbiCoder,
    defaultAbiCoder,

    Interface,
    Indexed,

    /////////////////////////
    // Types

    CoerceFunc,
    JsonFragment,
    JsonFragmentType,

    Result,
    checkResultErrors,

    LogDescription,
    TransactionDescription

} = require("@quais/abi");
```

License
-------

MIT License
npm package: @quais/abstract-provider
Description: An Abstract Class for describing an Ethereum Provider for quais.
Latest version: 0.1.6

Abstract Provider
=================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for defining the common interface for a Provider, which in
quais differs quite substantially from Web3.js.

A Provider is an abstraction of non-account-based operations on a blockchain and
is generally not directly involved in signing transaction or data.

For signing, see the [Abstract Signer](https://www.npmjs.com/package/@quais/abstract-signer)
or [Wallet](https://www.npmjs.com/package/@quais/wallet) sub-modules.

For more information, see the [documentation](https://docs.ethers.io/v5/api/providers/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Provider,

    ForkEvent,
    BlockForkEvent,
    TransactionForkEvent,
    TransactionOrderForkEvent,

    // Types
    BlockTag,

    Block,
    BlockWithTransactions,

    TransactionRequest,
    TransactionResponse,
    TransactionReceipt,

    Log,
    EventFilter,

    Filter,
    FilterByBlockHash,

    EventType,
    Listener

} = require("@quais/abstract-provider");
```

License
-------

MIT License
npm package: @quais/abstract-signer
Description: An Abstract Class for desribing an Ethereum Signer for quais.
Latest version: 0.1.1

Abstract Signer
===============

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is an abstraction of an Ethereum account, which may be backed by a [private key](https://www.npmjs.com/package/@quais/wallet),
signing service (such as Geth or Parity with key managment enabled, or a
dedicated signing service such as Clef),
[hardware wallets](https://www.npmjs.com/package/@quais/hardware-wallets), etc.

For more information, see the [documentation](https://docs.ethers.io/v5/api/signer/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Signer,
    VoidSigner,

    // Types
    ExternallyOwnedAccount

} = require("@quais/abstract-signer");
```

License
-------

MIT License
npm package: @quais/address
Description: Utilities for handling Ethereum Addresses for quais.
Latest version: 0.1.2

Ethereum Address Utilities
==========================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for encoding, verifying and computing checksums for
Ethereum addresses and computing special addresses, such as those
enerated by and for contracts under various situations.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/address/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    getAddress,
    isAddress,

    getIcapAddress,

    getContractAddress,
    getCreate2Address

} = require("@quais/address");
```

License
-------

MIT License
npm package: @quais/base64
Description: Base64 coder.
Latest version: 0.1.0

Base64 Coder
============

function decode(textData: string): Uint8Array
---------------------------------------------

Decodes a base64 encoded string into the binary data.

```javascript
import * as base64 from "@quais/base64";

let encodedData = "...";
let data = base64.decode(encodedData);
console.log(data);
// { Uint8Array: [] }
```

function encode(data: Arrayish): string
---------------------------------------

Decodes a base64 encoded string into the binary data.

```javascript
import * as base64 from "@quais/base64";

let data = [ ];
let encodedData = base64.encode(data);
console.log(encodedData);
// "..."
```

License
=======

MIT License
npm package: @quais/basex
Description: Base-X without Buffer.
Latest version: 0.1.0

Base-X
======

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for encoding and decoding vinary data in arbitrary bases, but
is primarily for Base58 encoding which is used for various blockchain data.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/encoding/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    BaseX,

    Base32,
    Base58

} = require("@quais/basex");
```

License
-------

MIT License
npm package: @quais/bignumber
Description: BigNumber library used in quais.js.
Latest version: 0.1.0

Big Numbers
===========

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for handling arbitrarily large numbers and mathematic operations.

For more information, see the documentation for [Big Numbers](https://docs.ethers.io/v5/api/utils/bignumber/)
and [Fixed-Point Numbers](https://docs.ethers.io/v5/api/utils/fixednumber/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    BigNumber,

    FixedFormat,
    FixedNumber,

    formatFixed,

    parseFixed

    // Types

    BigNumberish

} = require("@quais/bignumber");
```


License
-------

MIT License
npm package: @quais/bytes
Description: Bytes utility functions for quais.
Latest version: 0.1.0

Byte Manipulation
=================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for manipulating binary data.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/bytes/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    isBytesLike,
    isBytes,

    arrayify,

    concat,

    stripZeros,
    zeroPad,

    isHexString,
    hexlify,

    hexDataLength,
    hexDataSlice,
    hexConcat,

    hexValue,

    hexStripZeros,
    hexZeroPad,

    splitSignature,
    joinSignature,

    // Types

    Bytes,
    BytesLike,

    DataOptions,

    Hexable,

    SignatureLike,
    Signature

} = require("@quais/bytes");
```


License
-------

MIT License
npm package: @quais/constants
Description: Common Quai constants used for quais.
Latest version: 0.1.2

Etehreum Constants
==================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains many frequently used constants when dealing with Ethereum.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/constants/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    AddressZero,
    HashZero,

    EtherSymbol,

    NegativeOne,
    Zero,
    One,
    Two,

    WeiPerEther,
    MaxUint256

} = require("@quais/constants");
```


License
-------

MIT License
npm package: @quais/contracts
Description: Contract abstraction meta-class for quais.
Latest version: 0.1.3

Ethereum Contract Meta-Class
============================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is creating (at run-time) an object which interacts with an on-chain
contract as a native JavaScript object.

If you are familiar with ORM for Databases, this is similar, but for smart contracts.

For more information, see the [documentation](https://docs.ethers.io/v5/api/contract/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Contract,
    ContractFactory,

    RunningEvent,

    // Types

    ContractInterface,

    Overrides,
    PayableOverrides,
    CallOverrides,

    PopulatedTransaction,

    EventFilter,

    ContractFunction,

    Event,
    ContractReceipt,
    ContractTransaction

} = require("@quais/contracts");
```


License
-------

MIT License
npm package: @quais/hardware-wallets
Description: Hardware Wallet support for quais.
Latest version: 0.1.0

Hardware Wallets
================

This is still very experimental.

I only have 1 ledger nano, and testing is done locally (CirlceCI doesn't have
ledgers plugged in ;)).

API
===

```
import { LedgerSigner } from "@quais/hardware-wallets";
const signer = new LedgerSigner(provider, type, path);
// By default:
//   - in node, type = "hid"
//   - path is the default Ethereum path (i.e.  `m/44'/60'/0'/0/0`)
```

License
=======

All quais code is MIT License.

Each hardware wallet manufacturer may impose additional license
requirements so please check the related abstraction libraries
they provide.

All Firefly abstraction is also MIT Licensed.
npm package: @quais/hash
Description: Hash utility functions for Ethereum.
Latest version: 0.1.0

Etheruem Hash Utilities
=======================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains several common hashing utilities (but not the actual hash functions).

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/hashing/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    isValidName,
    namehash,

    id,

    messagePrefix,
    hashMessage

} = require("@quais/hash");
```


License
-------

MIT License
npm package: @quais/hdnode
Description: BIP32 Hierarchal Deterministic Node operations.
Latest version: 0.1.1

Hierarchal Deterministic Utilities (BIP32)
==========================================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible computing, deriving, encoding and decoding Hierarchal-Deterministic
private keys.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/hdnode/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    HDNode,

    defaultPath,

    mnemonicToSeed,
    mnemonicToEntropy,
    entropyToMnemonic,
    isValidMnemonic,
    getShardAddressChildNode,
    getAllShardsAddressChildNode

    // Types

    Mnemonic

} = require("@quais/hdnode");
```


License
-------

MIT License
npm package: @quais/json-wallets
Description: Wallet management utilities for KeyStore and Crowdsale JSON wallets.
Latest version: 0.1.0

Secret Storage JSON Wallet Utilities
====================================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for encoding, decoding, encrypting and decrypting JSON wallet
formats.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    isCrowdsaleWallet,
    decryptCrowdsale,

    isKeystoreWallet,
    decryptKeystore,
    decryptKeystoreSync,
    encryptKeystore,

    getJsonWalletAddress,

    decryptJsonWallet,
    decryptJsonWalletSync,

    // Types

    ProgressCallback,

    EncryptOptions

} = require("@quais/json-wallets");
```


License
-------

MIT License
npm package: @quais/keccak256
Description: The keccak256 hash function for quais.
Latest version: 0.1.0

KECCAK256 Hash Function
=======================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for the identify function (i.e. KECCAK256) use in Ethereum.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/hashing/#utils-keccak256).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    keccak256

} = require("@quais/keccak256");
```


License
-------

MIT License
npm package: @quais/logger
Description: Logger utility functions for quais.
Latest version: 0.1.0

Logger
======

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for managing logging and errors to maintain a standard
structure.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/logger/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Logger,

    // Enums

    ErrorCode,

    LogLevel,

} = require("@quais/logger");
```


License
-------

MIT License.
npm package: @quais/networks
Description: Network definitions for quais.
Latest version: 0.1.0

Ethereum (and ilk) Network Definitions
======================================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for tracking common networks along with important
parameters for each.

For more information, see the [documentation](https://docs.ethers.io/v5/api/providers/types/#providers-Network).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    getNetwork,

    // Types

    Network,
    Networkish

} = require("@quais/networks");
```


License
-------

MIT License
npm package: @quais/pbkdf2
Description: The PBKDF2 password-pbased key derivation function for quais.
Latest version: 0.1.0

Password-Based Key Derivation Function 2 (pbkdf2)
=================================================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains the PBKDF2 function.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    pbkdf2

} = require("@quais/pbkdf2");
```


License
-------

MIT License
npm package: @quais/properties
Description: Properties utility functions for quais.
Latest version: 0.1.0

Property Utilities
==================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains several useful utility methods for managing simple objects with
defined properties.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/properties/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    defineReadOnly,

    getStatic,

    resolveProperties,
    checkProperties,

    shallowCopy,
    deepCopy,

    Description,

    // Types

    Deferrable

} = require("@quais/properties");
```


License
-------

MIT License
npm package: @quais/providers
Description: Ethereum Providers for quais.
Latest version: 0.1.8

Ethereum Providers
==================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains common Provider classes, utility functions for dealing with providers
and re-exports many of the classes and types needed to implement a custom Provider.

For more information, see the [documentation](https://docs.ethers.io/v5/api/providers/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Provider,
    BaseProvider,

    JsonRpcProvider,
    StaticJsonRpcProvider,
    UrlJsonRpcProvider,

    FallbackProvider,

    AlchemyProvider,
    CloudflareProvider,
    EtherscanProvider,
    InfuraProvider,
    NodesmithProvider,

    IpcProvider,

    Web3Provider,

    WebSocketProvider,

    JsonRpcSigner,

    getDefaultProvider,

    getNetwork,

    Formatter,

    // Types

    TransactionReceipt,
    TransactionRequest,
    TransactionResponse,

    Listener,

    ExternalProvider,

    Block,
    BlockTag,
    EventType,
    Filter,
    Log,

    JsonRpcFetchFunc,

    Network,
    Networkish

} = require("@quais/providers");
```


License
-------

MIT License
npm package: @quais/random
Description: Random utility functions for quais.
Latest version: 0.1.0

Random Value Utilities
======================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains functions to assist with random numbers.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/bytes/#byte-manipulation--random-bytes).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    shuffled,

    randomBytes

} = require("@quais/random");
```


License
-------

MIT License
npm package: @quais/rlp
Description: Recursive-Length Prefix (RLP) coder.
Latest version: 0.1.0

Recursive-Length Prefix Coder
=============================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains functions for encoding and decoding RLP data.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/encoding/#rlp--methods).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    encode,
    decode

} = require("@quais/rlp");
```


License
-------

MIT License
npm package: @quais/sha2
Description: The SHA2 family hash functions and HMAC functions for quais.
Latest version: 0.1.0

SHA2 Hash Functions
===================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for common cryptographic hashes and HMAC.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/hashing/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    ripemd160,

    sha256,
    sha512,

    computeHmac,

    // Enums

    SupportedAlgorithm

} = require("@quais/sha2");
```


License
-------

MIT License
npm package: @quais/signing-key
Description: Elliptic curve library functions for the secp256k1 curve.
Latest version: 0.1.0

Signing Key
===========

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It is responsible for secp256-k1 signing, verifying and recovery operations.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/signing-key/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    SigningKey,

    computePublicKey,
    recoverPublicKey

} = require("@quais/signing-key");
```

License
-------

MIT License
npm package: @quais/solidity
Description: Solidity coder for non-standard (tight) packing.
Latest version: 0.1.0

Solidity Packed-Encoding Utilities
==================================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains functions to perform Solidity-specific packed (i.e. non-standard)
encoding operations.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/hashing/#utils--solidity-hashing).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    pack,
    keccak256,
    sha256

} = require("@quais/solidity");
```


License
-------

MIT License
npm package: @quais/strings
Description: String utility functions.
Latest version: 0.1.0

String Manipulation Utilities
=============================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains functions to safely convert between UTF-8 data, strings and Bytes32 strings
(i.e. "short strings").

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/strings/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    toUtf8Bytes,
    toUtf8CodePoints,
    toUtf8String,

    formatBytes32String,
    parseBytes32String,

    nameprep

    // Enums

    Utf8ErrorFuncs,
    Utf8ErrorReason,

    UnicodeNormalizationForm

    // Types

    Utf8ErrorFunc,

} = require("@quais/strings");
```


License
-------

MIT License
npm package: @quais/testcases
Description: Testcases for Ethereum and scripts to generate testcases.
Latest version: 0.1.0

Testcases for Ethereum
======================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains the testcases used to verify various Ethereum operations.

For more information, see the [documentation](https://docs.ethers.io/v5/testing/).


License
-------

MIT License
npm package: @quais/tests
Description: Testing package for quais.
Latest version: 5.7.1

Mocha Test Suite for Ethers
===========================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains the tests to verify quais is working correctly.

For more information, see the [documentation](https://docs.ethers.io/v5/testing/).

License
-------

MIT License
npm package: @quais/transactions
Description: Utilities for decoding and encoding Ethereum transaction for quais.
Latest version: 0.1.2

Ethereum Transaction Utilities
==============================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains various functions for encoding and decoding serialized transactios.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/transactions/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    computeAddress,
    recoverAddress,

    serialize,
    parse,

    // Types

    Transaction,
    UnsignedTransaction

} = require("@quais/transactions");
```


License
-------

MIT License
npm package: @quais/units
Description: Unit conversion functions for Ethereum.
Latest version: 0.1.0

Ethereum Unit Conversion Utilities
==================================

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains functions to convert between string representations and numeric
representations of numbers, including those out of the range of JavaScript.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/display-logic/).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    formatUnits,
    parseUnits,

    formatEther,
    parseEther,

    commify

} = require("@quais/units");
```


License
-------

MIT License
npm package: @quais/wallet
Description: Classes for managing, encrypting and decrypting Ethereum private keys as a Signer for quais.
Latest version: 0.1.1

Ethereum Wallet
===============

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains the class to manage a private key and signing for a standard
externally-owned account.

For more information, see the [documentation](https://docs.ethers.io/v5/api/signer/#Wallet).


Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    Wallet,

    verifyMessage

} = require("@quais/wallet");
```


License
-------

MIT License
npm package: @quais/web
Description: Utility fucntions for managing web requests for quais.
Latest version: 0.1.0

Web Utilities
=============

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

It contains functions to abstract safely and responsibly connecting to the web,
including exponential back-off.

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/web/).

Importing
---------

Most users will prefer to use the [umbrella package](https://www.npmjs.com/package/quais),
but for those with more specific needs, individual components can be imported.

```javascript
const {

    fetchJson,

    poll,

    // Types
    ConnectionInfo,
    FetchJsonResponse,

    PollOptions,
    OncePollable,
    OnceBlockable

} = require("@quais/web");
```


License
-------

MIT License
npm package: @quais/wordlists
Description: Word lists for BIP39 wallets.
Latest version: 0.1.0

BIP39 Wordlists
===============

This sub-module is part of the [quais project](https://github.com/quais-io/quais.js).

Supported Languages:

- **en** - English
- **es** - Spanish
- **fr** - French
- **it** - Italian
- **ja** - Japanese
- **ko** - Korean
- **zh_cn** - Chinese (simplified)
- **zh_tw** - Chinese (traditional)

For more information, see the [documentation](https://docs.ethers.io/v5/api/utils/wordlists/).


Browser
-------

In the browser distribution file, only the English word list is included in the
root `quais` pacakge. To include additional word lists, they must be added using
additional `<script>` tags, **after** the root `quais` library has been included.


License
-------

MIT License
npm package: @quajs/get-func-exports
Description: Get function exports from JavaScript text
Author: BackRunner
Latest version: 0.1.2

# @quajs/get-func-exports

Extract function definitions from JavaScript text and convert them to exports.

## Usage

Step 1: Install the package.

```bash
npm i @quajs/get-func-exports
```

Step 2: Import and use it.

```js
import getFuncExports from '@quajs/get-func-exports';

const exported = getFuncExports(`
function sum(a, b) {
  return a + b;
}
`);

console.log(exported.sum(1, 2)); // will get 3
```

## Example

Input text:

```js
function sum(a, b) {
  return a + b;
}

function select1(index) {
  console.log(sum(1, 2));
  if (index === 0) {
    return 'section1-select-2';
  }
}

const select2 = (index) => {
  const t = () => {
    setTimeout(() => {
      console.log(1);
    }, 0);
  };
  function t2() {}
  if (index === 1) {
    return 'section1-select-3';
  }
};
```

Output script:

```js
const exported = Object.create(null);
with (exported) {
  exported.sum = function (a, b) {
    return a + b;
  };

  exported.select1 = function (index) {
    console.log(sum(1, 2));
    if (index === 0) {
      return 'section1-select-2';
    }
  };

  exported.select2 = (index) => {
    const t = () => {
      setTimeout(() => {
        console.log(1);
      }, 0);
    };
    function t2() {}
    if (index === 1) {
      return 'section1-select-3';
    }
  };
}

return exported;
```

The `with` statement maintains the correctness of the reference, all top-level function definitions are transformed into assignments.

So we can use `new Function` to execute the script and get all definitions as exports.

## License

MIT
npm package: @quajs/store
Description: Persistent browser-side state management module.
Author: BackRunner
Latest version: 0.1.0

# QuaStore

Persistent browser-side state management module.

This package was developed primarily for the needs of QuaEngine, but it also supports the standalone usage.

## Features

- Presistent state management, APIs are inspired by `vuex`.

- Multi-Slot Continuous Storage.

- Provide composition APIs for convenience.

- TypeScript supported.

## Usage

### How to create a store

Step 1: Install this package from `npm`.

```bash
npm i @quajs/store -S
```

Step 2: Create store.

```js
import { QuaStoreManager } from '@quajs/store';

QuaStoreManager.createStore({
  name: 'my-store',
  state: {
    value: 0,
  },
  mutations: {
    setValue(state, payload) {
      state.value = payload;
    },
  },
});
```

Step 3: Use store at anywhere.

```js
import { useStore } from '@quajs/store';
const store = useStore('my-store');

// or

import { QuaStoreManager } from '@quajs/store';
const store = QuaStoreManager.getStore('my-store');
store.commit('setValue', 1);
console.log(store.state.value); // 1
```

Also, you can instantiate a standalone store for more flexible usage.

```js
const store = new QuaStore('store-name', {
  state: {},
  mutations: {},
  getters: {},
});
```

The standalone instance cannot be indexed by `QuaStoreManager`, so the manager methods will not be effected on this instance.

### Persist and restore data

QuaStore is using `dexie` (An IndexedDB wrap) to persist data.

```js
await store.persist(1);
```

Store instance can persist state to a certain slot, like the save in a video game.

Using the `restore` method can restore the persisted state to store.

```js
await store.restore(1);
```

If parameter `slot` is a `number`, it cannot be smaller than 1. If you want to use a customize name, `string` is also acceptable for `slot`.

In general usage, `restore` often be called in initializing process, if you want to use the persisted state in database to overwrite the current ones, a `force` option is required.

```js
await store.restore(1, { force: true });
```

## Compatibility Warning

`QuaStore` used [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) to proceed `getters` in store, please be sure that the clients are compatible with `Proxy`.

## License

MIT