Code Monkey home page Code Monkey logo

cosmwasmjs's Issues

publish update?

There's been a lot of updates since the last release, including pretty core functionality like executeMultiple()

Gentle reminder to release with upgraded deps :)

(my use case for this isn't so much the stated goal of the Readme which is "to help new developers get started with their first dApps", but rather to import the JS needed in a project that loads the JS via regular script tag and doesn't have a bundler)

Subscribe/Listen to contract events

I have cosmwasm smart contracts on the Osmosis side chain. I want to be able to interact with the contract from my Javascript application using the contract abi. the docs provide a way to query the read only methods using the CosmWasm client, but I don't see a way to instantiate the contract in my Javascript app using the abi and listen or subscribe to events emitted by the contract.

Please help or point to the right docs that helps me does this.

Create UMD module and add as installation method to docs

Having an UMD module allows web developers to get started with a plain HTML page and a script tag. No bundler needed. Since we have a single package here (in conntrast to CosmJS), it would be great to try this out.

This has been requested at cosmos/cosmjs#998. Also Terra.js in the browser shows how this can be offered to the user. Being able to use CosmWasmJS in a jsfiddle seems like an interesting opportunity we get with this.

Roll out exported symbols in index.ts

It would be great to have all exported symbols of the package visible in one file. For this, can we make the *s in

CosmWasmJS/src/index.ts

Lines 1 to 13 in a2a013a

/**
* Exporting all the defined CosmJS symbols
*/
export * from "./amino";
export * from "./cosmwasm-stargate";
export * from "./crypto";
export * from "./encoding";
export * from "./faucet-client";
export * from "./ledger-amino";
export * from "./math";
export * from "./proto-signing";
export * from "./stargate";
export * from "./utils";
explicit?

Maybe we should remove all the .ts files that only re-export CosmJS types and do that in the main index file directly.

What are RPC endpoints for testnet and mainnet?

basic example in docs goes:

const rpcEndpoint = "https://rpc.cliffnet.cosmwasm.com:443/";

async function main() {
  const client = await CosmWasmClient.connect(rpcEndpoint);
  console.log(client);
}

I've tried to log const height = await client.getBlock() and got 386,152.

According to https://gaia.bigdipper.live , block height of stargate-final (testnet) is 2,832,763 and https://cosmos.bigdipper.live shows 9,506,024 for cosmoshub-4 mainnet. What am I missing? What's this "386,152"?

What endpoint should I use for testnet? For mainnet? I've found that https://stargate.cosmos.network/testnet states that public RPC endpoint is 34.71.170.158:26657. I've tried both const rpcEndpoint = "http://34.71.170.158:26657/"; and https version and got Error: connect ECONNREFUSED 34.71.170.158:26657 for each.

Error: Invalid string. Length must be a multiple of 4

Summary of the bug

We try to use the newest CosmWasmJS (1.1.1) to connect to newest Wasmd (taken from main branch). Transaction gets committed successfully on chain but as a response we get this error in the client:

/Users/msedzinski/git/client/node_modules/base64-js/index.js:26 
[1]     throw new Error('Invalid string. Length must be a multiple of 4')

I think the error is related to those issues (already closed):
cosmos/cosmos-sdk#11997
ping-pub/faucet#4

Solution, mentioned there, is to update cosmjs client.

Are there any plans to do that anytime soon?

Versions

CosmWasmJS 1.1.1
Wasmd - main branch
CosmJS - 0.28 (which seems to be to old)

Steps to reproduce

  1. Run Wasmd
  2. Generate transaction from CosmWasmJS that emits event
  3. Error happens each time

Full error stack

1] /Users/msedzinski/git/wasp-viaterna-client/node_modules/base64-js/index.js:26
[1]     throw new Error('Invalid string. Length must be a multiple of 4')
[1]           ^
[1] 
[1] Error: Invalid string. Length must be a multiple of 4
[1]     at getLens (/Users/msedzinski/git/wasp-viaterna-client/node_modules/base64-js/index.js:26:11)
[1]     at Object.toByteArray (/Users/msedzinski/git/wasp-viaterna-client/node_modules/base64-js/index.js:55:14)
[1]     at fromBase64 (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/encoding/build/base64.js:32:21)
[1]     at decodeAttribute (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:40:40)
[1]     at Array.map (<anonymous>)
[1]     at decodeAttributes (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:45:53)
[1]     at decodeEvent (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:50:40)
[1]     at Array.map (<anonymous>)
[1]     at decodeEvents (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:55:49)
[1]     at decodeTxData (/Users/msedzinski/git/wasp-viaterna-client/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js:63:31)

Could the readonly Cosmwasm client include configuration?

While the provided example is very simple to understand,
I think this page is missing the configuration to make it run from a browser (webpack etc).

Could someone publish the tsconfig.json, webpack.config.js and the command to run this from a browser? Then it will really be beginner friendly.

searchTx returns 502 for mainnet

Here's what I've tried:

const rpcEndpoint = "https://rpc.cosmos.network/";
const client = CosmWasmClient.connect(rpcEndpoint);
const someAddressFromMainnet = "cosmos1l0znsvddllw9knha3yx2svnlxny676d8ns7uys";
const txs = await client.searchTx({
    sentFromOrTo: someAddressFromMainnet,
});

Explorer shows that the account exists and has participated a number of txs, but I'm getting the 502 error.

Is it me doing something wrongly or CosmWasmJS/mainnet public RPC/explorer's problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.