Skip to content
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
**/dist
**/dist_spec
**/yarn-error.log
lerna-debug.log
lerna-debug.log
200 changes: 154 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
# InterchainJS

<p align="center">
<img src="https://raw.githubusercontent.com/hyperweb-io/interchainjs/refs/heads/main/assets/logo.svg" width="280">
<p align="center" style={{ marginBottom: "20px" }}>
<img
src="https://raw.githubusercontent.com/hyperweb-io/interchainjs/refs/heads/main/assets/logo.svg"
width="280"
/>
</p>

<p align="center" width="100%">
<p
align="center"
width="100%"
style={{
display: "flex",
justifyContent: "center",
alignItems: "center",
gap: "2px",
}}
>
<a href="https://github.com/hyperweb-io/interchainjs/actions/workflows/run-tests.yaml">
<img height="20" src="https://github.com/hyperweb-io/interchainjs/actions/workflows/run-tests.yaml/badge.svg" />
<img
height="20"
src="https://github.com/hyperweb-io/interchainjs/actions/workflows/run-tests.yaml/badge.svg"
/>
</a>
<a href="https://github.com/hyperweb-io/interchainjs/blob/main/LICENSE-MIT">
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg" />
</a>
<a href="https://github.com/hyperweb-io/interchainjs/blob/main/LICENSE-Apache">
<img
height="20"
src="https://img.shields.io/badge/license-Apache-blue.svg"
/>
</a>
<a href="https://github.com/hyperweb-io/interchainjs/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="https://github.com/hyperweb-io/interchainjs/blob/main/LICENSE-Apache"><img height="20" src="https://img.shields.io/badge/license-Apache-blue.svg"></a>
</p>

A single, universal signing interface for any network. Birthed from the interchain ecosystem for builders. Create adapters for any Web3 network.
Expand All @@ -18,13 +40,14 @@ A single, universal signing interface for any network. Birthed from the intercha

- [Introduction](#interchainjs-universal-signing-for-web3)
- [Overview](#overview)
- [Tutorials and Docs](#tutorial-for-building-a-custom-signer)
- [Auth](#auth)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Create Interchain App](#quick-setup-with-create-interchain-app)
- [Supported Networks](#supported-networks)
- [Cosmos Network](#cosmos-network)
- [Injective Network](#injective-network)
- [Ethereum Network](#ethereum-network)
- [Interchain JavaScript Stack ⚛️](#interchain-javascript-stack-️)
- [Interchain JavaScript Stack ⚛️](#interchain-javascript-stack-️)
- [Credits](#credits)
- [Disclaimer](#disclaimer)

Expand Down Expand Up @@ -86,80 +109,165 @@ graph LR
style utils fill:#ccf,stroke:#333,stroke-width:2px
```

## Installation

---
This guide will walk you through the process of installing and setting up interchainjs for your project.

You can install interchainjs using Yarn:

## Tutorials & Documentation
```bash
yarn add interchainjs
yarn add @interchainjs/cosmos
```

| Topic | Documentation |
|----------------------------------|--------------|
| **Building a Custom Signer** | [Tutorial](/docs/tutorial.md) |
| **Advanced Documentation** | [View Docs](/docs/) |
or npm

```bash
npm i interchainjs
npm i @interchainjs/cosmos
```

## Quick Start

Get a signing client to send the trasactions:

```ts
import { SigningClient as CosmosSigningClient } from "@interchainjs/cosmos";

const signingClient = await CosmosSigningClient.connectWithSigner(
await getRpcEndpoint(),
new DirectGenericOfflineSigner(directSigner),
{
registry: [
// as many as possible encoders registered here.
MsgDelegate,
MsgSend,
],
broadcast: {
checkTx: true,
},
}
);

// sign and broadcast
const result = await signingClient.signAndBroadcast(<MESSAGE>[]);
console.log(result.hash); // the hash of TxRaw
```

Use the tree shakable helper functions provided by interchainjs or generated by telescope for query or send the transctions:

```ts
import { SigningClient as CosmosSigningClient } from "@interchainjs/cosmos/signing-client";
import { getBalance } from "interchainjs/cosmos/bank/v1beta1/query.rpc.func";
import { submitProposal } from "interchainjs/cosmos/gov/v1beta1/tx.rpc.func";

// query to get balance
const { balance } = await getBalance(await getRpcEndpoint(), {
address: directAddress,
denom,
});

const signingClient = await CosmosSigningClient.connectWithSigner(
await getRpcEndpoint(),
new DirectGenericOfflineSigner(directSigner),
{
// no registry needed here anymore
// registry: [
// ],
broadcast: {
checkTx: true,
},
}
);

// Necessary typeurl and codecs will be registered automatically in the helper functions. Meaning users don't have to register them all at once.
const result = await submitProposal(
signingClient,
directAddress,
{
proposer: directAddress,
initialDeposit: [
{
amount: "1000000",
denom: denom,
},
],
content: {
typeUrl: "/cosmos.gov.v1beta1.TextProposal",
value: TextProposal.encode(contentMsg).finish(),
},
},
fee,
"submit proposal"
);
console.log(result.hash); // the hash of TxRaw
```

---

## Auth
### Quick Setup with create-interchain-app

The authentication module is universally applied across different networks.
The easiest way to get started is by using the create-interchain-app tool, which sets up a complete project with all necessary dependencies:

```bash
npm install -g create-interchain-app

cia --example authz
```

| Package | Description |
|---------|-------------|
| [@interchainjs/auth](/packages/auth/README.md) | Handles authentication across blockchain networks. |
| [Advanced Docs: `Auth vs. Wallet vs. Signer`](/docs/auth-wallet-signer.md) | Explanation of the differences between authentication, wallets, and signers. |
Then an authz example website will be created and users can take a look how signing clients and helper functions are used.

---

## Supported Networks

### Cosmos Network

| Feature | Package |
|---------|---------|
| **Transactions** | [@interchainjs/cosmos](/networks/cosmos/README.md) |
| **Cosmos Types** | [@interchainjs/cosmos-types](/networks/cosmos-msgs/README.md) |
| **Migration from `@cosmjs`** | [Migration Guide](/docs/migration-from-cosmjs.md) |
| Feature | Package |
| ---------------------------- | ------------------------------------------------------------- |
| **Transactions** | [@interchainjs/cosmos](https://docs.hyperweb.io/interchain-js/networks/cosmos) |
| **Cosmos Types** | [@interchainjs/cosmos-types](https://docs.hyperweb.io/interchain-js/libs/cosmos-types) |
| **Migration from `@cosmjs`** | [Migration Guide](https://docs.hyperweb.io/interchain-js/advanced/migration-from-cosmjs.mdx) |

---

### Injective Network

| Feature | Package |
|---------|---------|
| **Transactions** | [@interchainjs/injective](/networks/injective/README.md) |
| Feature | Package |
| ---------------- | -------------------------------------------------------- |
| **Transactions** | [@interchainjs/injective](https://docs.hyperweb.io/interchain-js/networks/injective) |

---

### Ethereum Network

| Feature | Package |
|---------|---------|
| **Transactions** | [@interchainjs/ethereum](/networks/ethereum/README.md) |
| Feature | Package |
| ---------------- | ------------------------------------------------------ |
| **Transactions** | [@interchainjs/ethereum](https://docs.hyperweb.io/interchain-js/networks/ethereum) |

---

## Interchain JavaScript Stack ⚛️

A unified toolkit for building applications and smart contracts in the Interchain ecosystem

| Category | Tools | Description |
|----------------------|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| **Chain Information** | [**Chain Registry**](https://github.com/hyperweb-io/chain-registry), [**Utils**](https://www.npmjs.com/package/@chain-registry/utils), [**Client**](https://www.npmjs.com/package/@chain-registry/client) | Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. |
| **Wallet Connectors**| [**Interchain Kit**](https://github.com/hyperweb-io/interchain-kit)<sup>beta</sup>, [**Cosmos Kit**](https://github.com/hyperweb-io/cosmos-kit) | Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. |
| **Signing Clients** | [**InterchainJS**](https://github.com/hyperweb-io/interchainjs)<sup>beta</sup>, [**CosmJS**](https://github.com/cosmos/cosmjs) | A single, universal signing interface for any network |
| **SDK Clients** | [**Telescope**](https://github.com/hyperweb-io/telescope) | Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. |
| **Starter Kits** | [**Create Interchain App**](https://github.com/hyperweb-io/create-interchain-app)<sup>beta</sup>, [**Create Cosmos App**](https://github.com/hyperweb-io/create-cosmos-app) | Set up a modern Interchain app by running one command. |
| **UI Kits** | [**Interchain UI**](https://github.com/hyperweb-io/interchain-ui) | The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. |
| **Testing Frameworks** | [**Starship**](https://github.com/hyperweb-io/starship) | Unified Testing and Development for the Interchain. |
| **TypeScript Smart Contracts** | [**Create Hyperweb App**](https://github.com/hyperweb-io/create-hyperweb-app) | Build and deploy full-stack blockchain applications with TypeScript |
| **CosmWasm Contracts** | [**CosmWasm TS Codegen**](https://github.com/CosmWasm/ts-codegen) | Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. |
| Category | Tools | Description |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **Chain Information** | [**Chain Registry**](https://github.com/hyperweb-io/chain-registry), [**Utils**](https://www.npmjs.com/package/@chain-registry/utils), [**Client**](https://www.npmjs.com/package/@chain-registry/client) | Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application. |
| **Wallet Connectors** | [**Interchain Kit**](https://github.com/hyperweb-io/interchain-kit)<sup>beta</sup>, [**Cosmos Kit**](https://github.com/hyperweb-io/cosmos-kit) | Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface. |
| **Signing Clients** | [**InterchainJS**](https://github.com/hyperweb-io/interchainjs)<sup>beta</sup>, [**CosmJS**](https://github.com/cosmos/cosmjs) | A single, universal signing interface for any network |
| **SDK Clients** | [**Telescope**](https://github.com/hyperweb-io/telescope) | Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules. |
| **Starter Kits** | [**Create Interchain App**](https://github.com/hyperweb-io/create-interchain-app)<sup>beta</sup>, [**Create Cosmos App**](https://github.com/hyperweb-io/create-cosmos-app) | Set up a modern Interchain app by running one command. |
| **UI Kits** | [**Interchain UI**](https://github.com/hyperweb-io/interchain-ui) | The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. |
| **Testing Frameworks** | [**Starship**](https://github.com/hyperweb-io/starship) | Unified Testing and Development for the Interchain. |
| **TypeScript Smart Contracts** | [**Create Hyperweb App**](https://github.com/hyperweb-io/create-hyperweb-app) | Build and deploy full-stack blockchain applications with TypeScript |
| **CosmWasm Contracts** | [**CosmWasm TS Codegen**](https://github.com/CosmWasm/ts-codegen) | Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. |

## Credits

🛠 Built by Hyperweb (formerly Cosmology) — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io)
🛠 Built by Hyperweb (formerly Cosmology) — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io)

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED AS IS, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
7 changes: 7 additions & 0 deletions docs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"index": "Overview",
"networks": "Networks",
"libs": "Libs",
"packages": "Packages",
"advanced": "Advanced"
}
8 changes: 8 additions & 0 deletions docs/advanced/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"auth-wallet-signer": "Auth Wallet Signer",
"auth": "Auth",
"migration-from-cosmjs": "Migration from CosmJS",
"signer": "Signer",
"tutorial": "Tutorial",
"wallet": "Wallet"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading