https://github.com/graphprotocol/cosmoshub-ts
https://github.com/graphprotocol/cosmoshub-ts
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/graphprotocol/cosmoshub-ts
- Owner: graphprotocol
- Created: 2022-05-25T18:40:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-16T07:30:37.000Z (almost 3 years ago)
- Last Synced: 2025-03-23T18:51:48.107Z (10 months ago)
- Language: TypeScript
- Size: 266 KB
- Stars: 4
- Watchers: 10
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# cosmoshub-ts
TypeScript/AssemblyScript library for decoding Cosmos Hub messages.
## Usage
```typescript
import { cosmos, google } from "@graphprotocol/cosmoshub-ts";
function logDelegator(any: google.protobuf.Any) {
if (any.typeUrl == '/cosmos.staking.v1beta1.MsgDelegate') {
const message = cosmos.staking.v1beta1.decodeMsgDelegate(any.value);
console.log(message.delegatorAddress);
}
}
```
## Development
Install [Protocol Buffer Compiler](https://github.com/protocolbuffers/protobuf/releases) (`protoc`) and [Lerna](https://lerna.js.org/).
### Fetch dependencies
```bash
git submodule update --init --force
```
### Build and test
```bash
yarn
yarn build
yarn test
```
## Update dependencies
In order to update a dependency, change the value of the `branch` option in the corresponding section of the `.gitmodules` file.
> **Note**
> A submodule should always point to a tag.
```bash
git -C checkout
yarn build
yarn test
git commit -m
```