@gotabit/proto

1.1.27 • Public • Published

Gotabit Proto

usage

npm install @gotabit/proto

Send token

import { cosmos } from '@gotabit/proto'

const { send } = cosmos.bank.v1beta1.MessageComposer.fromPartial
const msg = send({
  fromAddress: 'from address',
  toAddress: 'receiver address',
  amount: [
    {
      amount: '3',
      denom: 'ugtb',
    },
  ],
})

IBC Messages

import { ibc } from '@gotabit/proto'

const { transfer } = ibc.applications.transfer.v1.MessageComposer.withTypeUrl

Cosmos Messages

import { cosmos } from '@gotabit/proto'

const {
  fundCommunityPool,
  setWithdrawAddress,
  withdrawDelegatorReward,
  withdrawValidatorCommission,
} = cosmos.distribution.v1beta1.MessageComposer.fromPartial

const { multiSend, send } = cosmos.bank.v1beta1.MessageComposer.fromPartial

const {
  beginRedelegate,
  createValidator,
  delegate,
  editValidator,
  undelegate,
} = cosmos.staking.v1beta1.MessageComposer.fromPartial

const { deposit, submitProposal, vote, voteWeighted } =
  cosmos.gov.v1beta1.MessageComposer.fromPartial

CosmWasm Messages

import { cosmwasm } from '@gotabit/proto'

const {
  clearAdmin,
  executeContract,
  instantiateContract,
  migrateContract,
  storeCode,
  updateAdmin,
} = cosmwasm.wasm.v1.MessageComposer.withTypeUrl

Credits

Code built with the help of these related projects:

  • @osmonauts/telescope a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs.
  • osmojs makes it easy to compose and broadcast Osmosis and Cosmos messages, with all of the proto and amino encoding handled for you.

Dependencies (2)

Dev Dependencies (5)

Package Sidebar

Install

npm i @gotabit/proto

Weekly Downloads

0

Version

1.1.27

License

MIT

Unpacked Size

4.74 MB

Total Files

405

Last publish

Collaborators

  • new_sunflower
  • wuchendi
  • roy_gotabit