Skip to content

Commit

Permalink
feat: add readme (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALPAC-4 authored Apr 9, 2024
1 parent 7ddb154 commit 6023a47
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/npm_publish_initia_registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: ["main"]
paths:
- _packages/initia_registry/package.json
- _packages/initia-registry/package.json

jobs:
publish_types:
Expand All @@ -17,10 +17,10 @@ jobs:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
working-directory: ./_packages/initia_registry
working-directory: ./_packages/initia-registry
- run: npm run build
working-directory: ./_packages/initia_registry
working-directory: ./_packages/initia-registry
- run: npm publish
working-directory: ./_packages/initia_registry
working-directory: ./_packages/initia-registry
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
20 changes: 20 additions & 0 deletions _packages/initia-registry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# initia-registry

The npm package for the [initia registry](https://github.com/initia-labs/initia-registry)

```
npm install @initia/initia-registry
```

## usage

Fetch data from initia-registry:

```typescript
import { assets, chains, ibc } from "@intiia/initia-registry";
import { Chain } from "@initia/initia-registry-types";

const assetList: Chain = assets.find(
({ chain_name }) => chain_name === "initia"
);
```
2 changes: 1 addition & 1 deletion _packages/initia-registry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia-registry",
"version": "0.1.1",
"version": "0.1.2",
"description": "Initia chain registry",
"main": "main/index.js",
"module": "esm/index.js",
Expand Down
26 changes: 26 additions & 0 deletions _packages/types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Initia Registry Types

This repository contains types and schema validation definitions for Initia Registry, which can be found at [Initia Registry GitHub Repository](https://github.com/initia-labs/initia-registry).

## Usage

### Installation

You can install the Initia Registry Types package via npm:

```bash
npm install @initia/initia-registry-types
```

### Imports

After installing the package, you can import the types and schemas in your TypeScript files as follows:

```typescript
import { Chain, AssetList, IBCInfo } from "@initia/initia-registry-types";
import {
ChainSchema,
AssetListSchema,
IBCInfoSchema,
} from "@initia/initia-registry-types/zod";
```
2 changes: 1 addition & 1 deletion _packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia-registry-types",
"version": "0.0.12",
"version": "0.0.13",
"description": "The package provides TypeScript type definitions and Zod integration for initia-registry.",
"types": "./dist/types/index.d.ts",
"exports": {
Expand Down

0 comments on commit 6023a47

Please sign in to comment.