open-index/open-npm huggingface dataset:
npm package: @setheum.js/evm-subql
Description: Subquery services that index and query Setheum EVM+ transactions and logs.
Author: Setheum JS Developers
Latest version: 0.0.1

# @setheum.js/evm-subql
Subquery services that index and query Setheum EVM+ transactions and logs.

## Run
### prepare

- build `eth-provider` package if haven't done it
```
rush update
rush build
```

- install project dependencies
```
yarn
```

- generate Typescript from the GraphQL schema, and build code. [more details](https://doc.subquery.network/quickstart/understanding-helloworld/#yarn-codegen)
```
yarn build
```

### run all services with docker
This includes a Setheum node within Docker.

```
docker-compose down && docker volume prune      # clean docker volume (optional)

docker-compose up                               # linux users
docker-compose -f macos-docker-compose.yml up   # mac users
```

Make sure to feed some EVM transactions to setheum node, for example we can use [these evm examples](https://github.com/Setheum-Labs/evm-examples).

### run each service seperately
- first install subql globally (recommended by the [official doc](https://doc.subquery.network/install/install/#install-subql-cli))
```
npm i -g @subql/node @subql/query
```

- run an [Setheum](https://github.com/Setheum-Labs/Setheum) node locally and listen to port 9944 (in terminal 1), and feed EVM data to it


- run a postgres service and listen to port 5432 (in terminal 2)
```
docker run -it -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres:12-alpine
```

- run a subquery indexer (in terminal 3)
```
export DB_USER=postgres
export DB_PASS=postgres
export DB_DATABASE=postgres
export DB_HOST=localhost
export DB_PORT=5432

yarn index
```

- run the Query service (in terminal 4)
```
export DB_USER=postgres
export DB_PASS=postgres
export DB_DATABASE=postgres
export DB_HOST=localhost
export DB_PORT=5432

yarn query
```

Now we can explorer graphql data at http://localhost:3001/ 🎉🎉

for example we can query
```graphql
query {
  transactionReceipts {
    nodes {
      id
      to
      from
      transactionHash
      transactionIndex
      gasUsed
      logs {
        nodes {
          id
        }
      }
    }
  }
  logs {
    nodes {
      id,
      blockNumber,
      blockHash,
      transactionIndex,
      address,
      data,
      transactionHash,
      receipt {
        id
      }
    }
  }
}
```

## Notes
- Other packages in `setters.js` use `rush` to manage, but we use `yarn` for this one. Since `rush update` will cause tslib import problem, because `rush` uses symlink so pacakges point to outside, but `subql/node`'s NodeVM doesn't allow import from outside.
npm package: @setheum.js/setcloud-pin
Description: Decentralized SetCloud pin on Setheum Network
Latest version: 2.1.0

# 📌 SetCloud Pin

This node package allows you to place a SetCloud storage order on the Setheum Network, and the whole network's IPFS storage nodes **will help you to pin your site/file in a super decentralized way**.

## Getting Started

- Install dependency

```shell
yarn add @setheum.js/setcloud-pin
```

- Create `SetCloudPinner`

Typescript sample

```typescript
import SetCloudPinner from '@setheum.js/setcloud-pin';

const setcloud = new SetCloudPinner(`${SETHEUM_ACCOUNT_SEEDS}`);

async function main() {
    await setcloud.pin('QmVAjL5AkQJ6uwWnJ78YXCVK6FB1cgPtYPRyjnPvoVmb3K');
}

main();
```

or Commonjs sample

```javascript
const setcloudPin = require('@setheum.js/setcloud-pin').default;

const setcloud = new setcloudPin(`${SETHEUM_ACCOUNT_SEEDS}`);

const main = async () => {
    await setcloud.pin('QmVAjL5AkQJ6uwWnJ78YXCVK6FB1cgPtYPRyjnPvoVmb3K');
}

main();
```

## Workflow

Simply to say, SetCloud Pin only handles the **tx-sending**. After that, the storage nodes which received this tx will pull the site from user's IPFS.

## Contribution
  
  Please send a PR(Pull Request) to contribute this repo and read the following rules:

  1. **No `--force` pushes** or modifying the master branch history in any way. If you need to rebase, ensure you do it in your own repo.
  2. **Non-main branches**, prefixed with a short name moniker (e.g. zik/my-feature) must be used for ongoing work.
  3. **All modifications** must be made in **pull-request** to solicit feedback from other contributors.
  4. A pull-request **must not be merged until CI** has finished successfully.
  5. Contributors should adhere to the [Google Typescript Style Guide](https://github.com/google/gts).
npm package: @setheum.js/setters
Description: setters.js SDK implements a web3 provider to allow existing Ethereum dApp to be able to interact with [Setheum EVM](https://github.com/Setheum-Labs/Setheum/tree/master/lib-serml/evm).
Author: Setheum JS Developers
Latest version: 2.2.0

# @setheum.js/setters.js

setters.js SDK implements a web3 provider to allow existing Ethereum dApp to be able to interact with [Setheum EVM](https://github.com/Setheum-Labs/Setheum/tree/master/lib-serml/evm).


## Getting Started

- Install dependencies

```
yarn
```

## Documentation

Most of the api of setters.js is compatible with ethers.js. If you are not familiar with ethers.js, you can start by looking at its [documentation](https://docs.ethers.io/v5/single-page/)

### Provider

The Provider provides some api for interacting with nodes and is an instance of `ethers.js` [AbstractProvider](https://docs.ethers.io/v5/single-page/#/v5/api/providers/-%23-providers).

#### Creating Instances

**new Provider( apiOptions )**

apiOptions has the same parameters as when creating an instance of apiPromise for polkadot.js 

```javascript
import { options } from "@setheum.js/api";
import { Provider } from "@setheum.js/setters";
import { WsProvider } from "@polkadot/api";

const evmprovider = new Provider(
  options({
    provider: new WsProvider("ws://localhost:9944")
  })
);
```

### Wallet

The Wallet class inherits Signer and can sign transactions and messages using a private key.

#### Creating Instances

**new Wallet( privateKey , provider? , keyringPair? )**

"privateKey" is the private key of evm's account. "provider" is an instance of [Provider](#Provider). "keyringPair" is a [key pair for polkadot](https://polkadot.js.org/docs/api/start/keyring). If the "keyringPair" is empty, a key pair will be generated from the 
"privateKey".

```javascript
import { Wallet } from "@setheum.js/setters";
const wallet = new Wallet("0xaa397267eaee48b2262a973fdcab384a758f39a3ad8708025cfb675bb9effc20", provider)
```


### Wallet.claimEvmAccounts()

Use "keyringpair" to bind an evm account generated by "privateKey".

```javascript
wallet.claimEvmAccounts()
```

## Examples

### deploy a contract

```javascript
import { deployContract } from "ethereum-waffle";
import ERC20Abi from "../build/ERC20Abi.json";
import { TestAccountSigningKey, Provider, Signer } from "@setheum.js/setters";
import { WsProvider } from "@polkadot/api";
import { createTestPairs } from "@polkadot/keyring/testingPairs";

const provider = new Provider({
  provider: new WsProvider("ws://127.0.0.1:9944"),
});

const testPairs = createTestPairs();

const signingKey = new TestAccountSigningKey(provider.api.registry);

signingKey.addKeyringPair(Object.values(testPairs));

const wallet = new Signer(provider, testPairs.alice.address, signingKey)

const tokenInstance = await deployContract(master, ERC20Abi, [1000]);
```
npm package: @setheum.js/settpay
Description: A web3 PolkadotJS API wrap that provides SettPay API package for the SettPaySDK.
Author: Muhammad-Jibril
Latest version: 3.0.3

# settpay{.js}

A web3 SetheumJS API endpoint that provides the crucial SettPay API package support for the SettPaySDK, built on the setheum-js stack.

## Build

Building `settpay{.js}`:

```bash
yarn install
yarn run build
```

## Test

Testing `settpay{.js}`:
open `./test/index.html` in chrome.
open chrome dev console and run `runTests().then(console.log)`