open-index/open-npm huggingface dataset:
npm package: @koingfu.com/sdk-bch
Description: 🛠 An SDK for building applications on top of KoingFu.
Latest version: 1.0.14

**Smart Bitcoin Cash**

SDK: https://www.npmjs.com/package/@koingfu.com/sdk-bch

# **SmartBCH**

- network id: 10000
- Core/Factory address: 0xC0ab3bF9d799F7b020dCaB3A450ED141bfAe3A1e
- Router/Periphery address: 0xb457805fedfc2467877dCfA153636C1D22aE6c6F
- wBCH address: 0xc4eb62f900ae917f8F86366B4C1727eb526D1275
- RPC address: [https://smartbch.greyh.at](https://smartbch.greyh.at/)
- Multicall address: [https://www.smartscan.cash/address/0x36BD320fAB5b9d2CFd81FBcf6046F81B4F71A0BC](https://www.smartscan.cash/address/0x36BD320fAB5b9d2CFd81FBcf6046F81B4F71A0BC)


# **SmartBCH Amber Testnet**

- network id: 10001 (or hex 0x2711)
- Core/Factory address: 0xC0ab3bF9d799F7b020dCaB3A450ED141bfAe3A1e
- Router/Periphery address: 0xb457805fedfc2467877dCfA153636C1D22aE6c6F
- wBCH address: 0x21c7FD76B440e443aafb364f31396a3Ea0b3Abe0
- RPC address: [https://moeing.tech:9545/](https://moeing.tech:9545/)
- Multicall address: [https://www.smartscan.cash/address/0xd337ef88a3aE59D1130bB31D365de407D8a85e6a](https://www.smartscan.cash/address/0xd337ef88a3aE59D1130bB31D365de407D8a85e6a)
npm package: @koingfu/koingfuswap-sdk
Description: 🛠 An SDK for building applications on top of Koingfu Swap.
Latest version: 1.0.2

# Koingfuswap SDK

In-depth documentation on this SDK is available at [uniswap.org](https://uniswap.org/docs/v2/SDK/getting-started/).

This modifies uniswap-sdk's UniswapV2Factory address. The new address for koingfuswap is  `0x04B14a27eE39bF4895c1c18cf693D104822391e5`.

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/koingfu/koingfuswap-sdk.git
```

Move into the koingfuswap-sdk working directory

```sh
cd koingfuswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @koinos/as-gen
Description: This is a `protoc` plugin to generate Koinos AssemblyScript Contract boilerplate code based on a proto file.
Author: Koinos Group
Latest version: 1.0.0

# koinos-as-gen
This is a `protoc` plugin to generate Koinos AssemblyScript Contract boilerplate code based on a proto file.

## Installation
```sh
# with npm
npm install --save-dev koinos-as-gen

# with yarn
yarn add --dev koinos-as-gen
```

## Important note
The plugin will generate a `CONTACT.boilerplate.ts` file and an `index.ts`, for this to work the proto file needs to follow these rules:
  - the proto file must like in a `proto` folder that is at the same level as the AssemblyScript files
  - arguments messages must be name as `METHODNAME_arguments`
  - result messages must be name as `METHODNAME_result` (you can also provide a custom result by using the `@result` decorator. The custom result MUST be within the same proto file)

## Usage

```sh
protoc --plugin=protoc-gen-as=./node_modules/.bin/koinos-as-gen --as_out=. myProtoFile.proto

// you can generate the "authorize" entry point by setting the GENERATE_AUTHORIZE_ENTRY_POINT env variable
GENERATE_AUTHORIZE_ENTRY_POINT=1 protoc --plugin=protoc-gen-as=./node_modules/.bin/koinos-as-gen --as_out=. myProtoFile.proto

// you can set the return buffer size of the contract by setting the RETURN_BUFFER_SIZE env variable
RETURN_BUFFER_SIZE=2048 protoc --plugin=protoc-gen-as=./node_modules/.bin/koinos-as-gen --as_out=. myProtoFile.proto
```

## Example
The following proto file:
```proto
syntax = "proto3";

package calculator;

// @description Add two integers
// @read-only true
message add_arguments {
  int64 x = 1;
  int64 y = 2;
}

message add_result {
  int64 value = 1;
}
```

will generate the following `Calculator.boilerplate.ts file:
```js
import { calculator } from "./proto/calculator";

export class Calculator {
  add(args: calculator.add_arguments): calculator.add_result {
    // const x = args.x;
    // const y = args.y;

    // YOUR CODE HERE

    const res = new calculator.add_result();
    // res.value = ;

    return res;
  }
}
```

and will generate the following `index.ts file:
```js
import { System, Protobuf } from "koinos-as-sdk";
import { Calculator as ContractClass } from "./Calculator";
import { calculator as ProtoNamespace } from "./proto/calculator";

export function main(): i32 {
  const entryPoint = System.getEntryPoint();
  const rdbuf = System.getContractArguments();
  let retbuf = new Uint8Array(1024);

  const c = new ContractClass();

  switch (entryPoint) {
    case 0x7e9e5ac3: {
      const args = Protobuf.decode<ProtoNamespace.add_arguments>(
        rdbuf,
        ProtoNamespace.add_arguments.decode
      );
      const res = c.add(args);
      retbuf = Protobuf.encode(res, ProtoNamespace.add_result.encode);
      break;
    }

    default:
      System.exitContract(1);
      break;
  }

  System.setContractResult(retbuf);

  System.exitContract(0);
  return 0;
}

main();
```
npm package: @koinos/proto-js
Description: This repository is automatically generated by [Koinos Proto](https://github.com/koinos/koinos-proto).
Author: Koinos Group
Latest version: 2.6.0

# koinos-proto-js

This repository is automatically generated by [Koinos Proto](https://github.com/koinos/koinos-proto).

Bug and feature requests should be submitted to [Koinos Proto Issues](https://github.com/koinos/koinos-proto/issues).

Pull requests should be submitted to [Koinos Proto Pull Requests](https://github.com/koinos/koinos-proto/pulls).
npm package: @koinos/sdk-as
Description: [![Test](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml/badge.svg)](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml)
Author: Roamin Ro
Latest version: 1.4.0

[![Test](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml/badge.svg)](https://github.com/koinos/koinos-sdk-as/actions/workflows/test.yml)

# koinos-sdk-as
AssemblyScript (AS) Software Development Toolkit (SDK) for the Koinos Blockchain

See documentation: https://koinos.github.io/koinos-sdk-as/

Learn how to create smart contracts by looking at the examples repo: https://github.com/roaminro/koinos-sdk-as-examples

## Requirements:
You need to install NodeJS v16 or higher [download](https://nodejs.org/en/download/)

## Installation

```sh
# with npm
npm install koinos-sdk-as

# with yarn
yarn add koinos-sdk-as
```
## Run unit tests
```sh
# with npm
npm test

# with yarn
yarn test
```

## Build test contract
```sh
# with npm
npm run buildTestContract

# with yarn
yarn run buildTestContract
```

## Upload and trigger the test contract on a local devnet using [Local-Koinos](https://github.com/roaminroe/local-koinos)
```sh
🚫 🔐 > open wallets/bob.wallet bob
Opened wallet: wallets/bob.wallet

🚫 🔓 > connect http://localhost:8080
Connected to endpoint http://localhost:8080

🔓 > register foobar 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g /test/abi/foobar.abi
Contract 'foobar' at address 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g registered

🔓 > foobar.foobar 42
Calling foobar.foobar with arguments 'value:42'
Transaction with ID 0x1220654597dfe99b4d5f841c129be39d3fe725539240b9efb43f8ea8ab4d9cd35742 containing 1 operations submitted.
Mana cost: 0.01831902 (Disk: 10, Network: 254, Compute: 1830532)
Logs:
entryPoint: 3282800625
contractArgs: 42
contractId (b58): 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
headInfo.head_block_time: 1645327982254
headInfo.head_topology.height: 7771
headInfo.last_irreversible_block.: 7711
callerData.caller_privilege: 1
lastIrreversibleBlock: 7711
putRes: 0
obj: testValue
putRes: 0
obj: testValue2
obj: testValue2
putRes3: 0
obj5.value: 42
no obj5
recoveredKey (b58): 1DQzuCcTKacbs9GGScRTU1Hc8BsyARTPqe
value2
no key5
value3
key3
value1
key1
nothing before key1
nothing after key3
obj201.value: 200
next obj202.value: 300
prev obj202.value: 100
nothing before key1
nothing after key3
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
payer: 161DDwJNQyHqYJbP4C7Y8BTULrkjgC4U6g
```
npm package: @koinos/sdk-as-cli
Description: ![Test Ubuntu](https://github.com/koinos/koinos-sdk-as-cli/actions/workflows/test-ubuntu.yml/badge.svg) ![Test Windows](https://github.com/koinos/koinos-sdk-as-cli/actions/workflows/test-windows.yml/badge.svg) ![Test MacOS](https://github.com/koinos/koino
Author: Koinos Group
Latest version: 1.0.2

![Test Ubuntu](https://github.com/koinos/koinos-sdk-as-cli/actions/workflows/test-ubuntu.yml/badge.svg)
![Test Windows](https://github.com/koinos/koinos-sdk-as-cli/actions/workflows/test-windows.yml/badge.svg)
![Test MacOS](https://github.com/koinos/koinos-sdk-as-cli/actions/workflows/test-macos.yml/badge.svg)


## Installation

```sh
# with npm
npm install -g @koinos/sdk-as-cli

# with yarn
yarn global add @koinos/sdk-as-cli
```

## Create a contract boilerplate
```sh
# will create "mycontract" in the current working folder
koinos-sdk-as-cli create mycontract
```

## Important note
- It important that your smart contract file lives in the `assembly` folder of your project. (i.e.: `assembly/Calculator.ts`)
- And, it is also important that your `proto` files live in the `assembly/proto/` folder of your project. (i.e.: `assembly/proto/calculator.proto`)

## Help
```sh
koinos-sdk-as-cli help
```
## Build a contract
```sh
# example for building a calculator contract
# build the debug version
koinos-sdk-as-cli build-all debug calculator.proto 

# build the release version
koinos-sdk-as-cli build-all release calculator.proto 
```

This will result in the generation of:

- a `calculator.abi` file in the folder `abi/`
- a `calculator-abi.json` file in the folder `abi/`
- a `contract.wasm` file in the folder `build/release` and `build/debug`
- an `index.ts` file in the folder `assembly/`
- a `Calculator.boilerplate.ts` file in the folder `assembly/`
  
## Generate ABI file
```sh
# example for a calculator contract
koinos-sdk-as-cli generate-abi calculator.proto
```
This will generate a calculator.abi file in the folder `abi/`

## Generate contract.boilerplate.ts and index.ts files
```sh
# example for a calculator contract
koinos-sdk-as-cli generate-contract-as calculator.proto
```

This will generate a `Calculator.boilerplate.ts`file and `index.ts` file in the folder `assembly/`

## Generate AssemblyScript files for all the proto files of a contract
```sh
koinos-sdk-as-cli generate-contract-proto
```

## Generate AS files for the given proto files
```sh
# example for a calculator contract
koinos-sdk-as-cli generate-as-proto calculator/assembly/proto/calculator.proto
```

## Run tests
```sh
koinos-sdk-as-cli run-tests
```