diff --git a/.github/workflows/npm_publish_initia_registry.yml b/.github/workflows/npm_publish_initia_registry.yml index 84902f7..01bd72e 100644 --- a/.github/workflows/npm_publish_initia_registry.yml +++ b/.github/workflows/npm_publish_initia_registry.yml @@ -4,7 +4,7 @@ on: push: branches: ["main"] paths: - - _packages/initia_registry/package.json + - _packages/initia-registry/package.json jobs: publish_types: @@ -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 }} diff --git a/_packages/initia-registry/README.md b/_packages/initia-registry/README.md new file mode 100644 index 0000000..384d16b --- /dev/null +++ b/_packages/initia-registry/README.md @@ -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" +); +``` diff --git a/_packages/initia-registry/package.json b/_packages/initia-registry/package.json index acffaf1..aaf9b38 100644 --- a/_packages/initia-registry/package.json +++ b/_packages/initia-registry/package.json @@ -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", diff --git a/_packages/types/README.md b/_packages/types/README.md new file mode 100644 index 0000000..c0e4b13 --- /dev/null +++ b/_packages/types/README.md @@ -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"; +``` diff --git a/_packages/types/package.json b/_packages/types/package.json index 1a0da2c..c2f119a 100644 --- a/_packages/types/package.json +++ b/_packages/types/package.json @@ -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": {