open-index/open-npm huggingface dataset:
npm package: @icpbox/js-sdk
Latest version: 1.1.2

## js-sdk


### install

```
npm login --registry=https://npm.pkg.github.com --scope=@icpbox

npm install @icpbox/js-sdk
```


### import

```
import icpbox from "@icpbox/js-sdk";
```


### check env



```
icpbox.check();
```

### check if dapp is connected

```js
const isChecked = icpbox.isconnected();
```


### connect dapp


| option    | required | type               | example                         |
| --------- | -------- | ------------------ | ------------------------------- |
| canisters | true     | string \| string[] | []                              |
| logo      | false    | string             | http://placeholder.org/test.png |

```js
await icpbox.authorize({
  canisters: [
    'canister_id'
  ]
}); 
```

### create actor
- authorize is required to create actor

```
  const nnsCanisterId = 'qoctq-giaaa-aaaaa-aaaea-cai';

  const nnsPartialInterfaceFactory = ({ IDL }) => {
    const BlockHeight = IDL.Nat64;
    const Stats = IDL.Record({
      'latest_transaction_block_height': BlockHeight,
      'seconds_since_last_ledger_sync': IDL.Nat64,
      'sub_accounts_count': IDL.Nat64,
      'hardware_wallet_accounts_count': IDL.Nat64,
      'accounts_count': IDL.Nat64,
      'earliest_transaction_block_height': BlockHeight,
      'transactions_count': IDL.Nat64,
      'block_height_synced_up_to': IDL.Opt(IDL.Nat64),
      'latest_transaction_timestamp_nanos': IDL.Nat64,
      'earliest_transaction_timestamp_nanos': IDL.Nat64,
    });
    return IDL.Service({
      'get_stats': IDL.Func([], [Stats], ['query']),
    });
  };

  // Create an actor to interact with the NNS Canister
  try {
    const NNSUiActor = await icpbox.createActor({
      canisterId: nnsCanisterId,
      interfaceFactory: nnsPartialInterfaceFactory,
    });

    const stats = await NNSUiActor.get_stats();
    console.log('NNS stats', stats);
  } catch (error) {
    console.log('error: ', error);
  }
```

### make payment

| option | required | type   | example      |
| ------ | -------- | ------ | ------------ |
| amount | true     | string |              |
| fee    | false    | strubg |              |
| to     | true     | string |              |
| memo   | true     | string | order_number |

```js
await icpbox.buy({
  to: "icpnftfi.icp",
  amount: "2",
  memo: "1232" // normally an order number is supplied
});
```

### disconnect dapp

```
icpbox.disConnect();
```
npm package: @icraft/common
Description: [![NPM version](https://img.shields.io/npm/v/@icraft/common.svg?style=flat)](https://npmjs.org/package/@icraft/common) [![NPM downloads](http://img.shields.io/npm/dm/@icraft/common.svg?style=flat)](https://npmjs.org/package/@icraft/common)
Author: yuanguandong
Latest version: 0.0.4

# @icraft/common

[![NPM version](https://img.shields.io/npm/v/@icraft/common.svg?style=flat)](https://npmjs.org/package/@icraft/common)
[![NPM downloads](http://img.shields.io/npm/dm/@icraft/common.svg?style=flat)](https://npmjs.org/package/@icraft/common)

This package contains common code used across the icraft ecosystem.

only for icraft internal use.



## LICENSE

Commercial license.
npm package: @icraft/store
Description: @icraft/store
Latest version: 0.0.4

# @icraft/store

[![NPM version](https://img.shields.io/npm/v/@icraft/store.svg?style=flat)](https://npmjs.org/package/@icraft/store)
[![NPM downloads](http://img.shields.io/npm/dm/@icraft/store.svg?style=flat)](https://npmjs.org/package/@icraft/store)


This is a general and very, very easy to use data flow management tool

## Install
``` bash
pnpm i @icraft/store -S
```
## Usage

```ts
// create a store in any where
import { Store } from '@icraft/store'

const store = new Store({
  count:0,
  name:'name'
})

// set state in any where
store.setState({
  count:1,
  name:'new name'
})

```

```tsx
// use the store in component
import { useStore } from '@icraft/store'

const [{count,name},setState] = useStore(store,['count','name'])

// update state in component
const handleClick = () => {
  setState({
    count:count+1,
  })
}

```

## LICENSE

MIT license.
npm package: @icrc/esm-user-dashboard-widgets
Description: A repo for creating openmrs microfrontend dashboard widgets
Latest version: 1.0.2-pre.7

# User Dashboard Widgets

ESM Package serves widgets for OpenMRS Dashboard Engine.

## Available Widgets

- Todo

- Appointment

- Charts

- Reports

## Pre-Requisites

NodeJS

## How to Setup?

- Run `npm install` to install all the dependencies

- Run `npm start -- --https --port 8082` to start application in dev mode.

- If you are using with OpenMRS Micro Frontend, update/add the port:url in `import-map.json` file of `openmrs-esm-root-config`.

- Run `npm run build` for production build.

## Widgets

- Appointments
- Charts
- Todos
- Reports

## Appointments

This widget shows the list of appointments. It also allows the user to perform various actions like checkin, confirm.

Please refer the [Architecture Decision Record](docs/adr-03-appointment-configuration.md) for more information about how to configure an appointment widget.

### Sample screenshots

#### Appointments

![Appointments](./screenshots/appointment.png "Appointments")

#### Todo's

[!Todo's](./screenshots/todo.png "Todo's"))

#### Charts

![Charts](./screenshots/charts.png "Charts")

## Charts

This widget shows the charts based on the configuration. Refer below to check list of chart types supported.

Please refer the [Architecture Decision Record](docs/adr-04-charts-configuration.md) for more information about how to configure a chart widget.

### Chart Types

- LineChart

## Reports

This widget shows a list of report links. It will show chart or table based on the configuration when a report link is clicked.

Please refer the [Architecture Decision Record](docs/adr-05-reports-configuration.md) for more information about the configure a report widget.
npm package: @icreate/core
Description: Ics核心包封装
Author: wenbei421
Latest version: 0.0.26

<!--
 * @Author: 文贝
 * @Date: 2022-02-08 21:36:57
 * @LastEditors: 文贝
 * @LastEditTime: 2022-04-28 15:32:19
 * @Descripttion: 
 * @FilePath: \README.md
-->
### Usage

```bash
npm i @icreate/core
```

### Features

 - Event:事件总线
 - BlockUI:加载等待UI
 - Logger:console.log封装
 - Utils:工具类
 - ics:ics对象

### Importing library

You can import the generated bundle to use the whole library generated by this starter:

```javascript
import { ics, Event, BlockUI, Logger, Utils, LogLevels, ExecOptons, UIOptions } from '@icreate/core'
```

### Event

```javascript
  $on(eventName: string, callback: Function): void
  $off(eventName: string, callback: Function): void
  $emit(eventName: string): void
```

### BlockUI

```javascript
  block(opts: UIOptions): void
  unblock(opts: UIOptions): void
  setBusy(opts: UIOptions): void
  clearBusy(opts: UIOptions): void
```

### Logger

```javascript
  level: LogLevels
  debug(logObject: any): void
  info(logObject: any): void
  warn(logObject: any): void
  error(logObject: any): void
  fatal(logObject: any): void
```

### Utils

```javascript
  createNamespace(root: any, ns: string): object
  replaceAll(str: string, search: string, replacement: string): string
  formatString(): string | null
  toPascalCase(str: string): string
  toCamelCase(str: string): string
  truncateString(str: string, maxLength: number): string
  truncateStringWithPostfix(str: string, maxLength: number, postfix: string): string
  isFunction(obj: any): boolean
  buildQueryString(key: string, value: string, expireDate: Date, path: string): void
  getCookieValue(key: string): string | null
  deleteCookie(key: string, path: string): void
  htmlEscape(html: string): string
  extend(dstObj: object, srcObj: object): object
  command(opts: ExecOptons): void
  function(opts: ExecOptons): Promise<any> 
  getFirstSpell(str: string): string | string[]
  getFullSpell(str: string) : string
  getStrokeCode(str: string): string
```