/osmosis-ts

Primary LanguageTypeScript

osmosis-ts

TypeScript/AssemblyScript library for decoding Osmosis messages.

Usage

import { osmosis, google } from "@graphprotocol/osmosis-ts";

function logSender(any: google.protobuf.Any) {
  if (any.typeUrl == '/osmosis.gamm.v1beta1.MsgSwapExactAmountOut') {
    const message = osmosis.gamm.v1beta1.decodeMsgSwapExactAmountOut(any.value);
    console.log(message.sender);
  }
}

Development

Install Protocol Buffer Compiler (protoc) and Lerna.

Fetch dependencies

git submodule update --init --force

Build and test

yarn install
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.

git -C <submodule_dir> checkout <new_tag>
yarn build
yarn test
git commit -m <submodule_dir>