cosmos-rest

A js sdk for cosmos blockchain

Usage no npm install needed!

<script type="module">
  import cosmosRest from 'https://cdn.skypack.dev/cosmos-rest';
</script>

README

cosmos-rest

JavaScript client for the Cosmos SDK API

Useage

npm i cosmos-rest -s

import Client from 'cosmos-rest';
//init cosmos server provider
const cosmosClient = new Client("http://192.168.16.11:1314");
/**
* @address  The address you should  query
*/
cosmosClient.query_account(address[, callback])
//Join Game
cosmosClient.join_game(signMsg[,callback])
//获取gsid
cosmosClient.get_gc(json[,callback])
//游戏行为
cosmosClient.player_action(gsid,json[,callback])
//退出游戏
cosmosClient.end_game(gsid,json[,callback])
//查询游戏筹码
cosmosClient.query_amount(gsid,json[,callback])
//状态迁移
cosmosClient.game_relay(json[,callback])
//交易查询
cosmosClient.query_tx(txhash[,callback])
//结束游戏并进行结算
cosmosClient.end_game_session(gsid[,callback])