Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add readme #31

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading