Git Product home page Git Product logo

orbs-client-sdk-javascript's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

al94hub

orbs-client-sdk-javascript's Issues

better error message on unsupported return type

When accidentally returning a boolean from the contract, I get the error:

     Error: received argument 0 has unknown type: 65535
      at Ce (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:8:29510)
      at et (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:8:38018)
      at e.<anonymous> (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:8:47002)
      at c (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:171510)
      at Generator._invoke (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:171298)
      at Generator.e.<computed> [as next] (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:171932)
      at r (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:24553)
      at o (node_modules/orbs-client-sdk/dist/orbs-client-sdk.js:1:24763)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

a better error message could state the supported types, and/or direct to the data types documentation.

Add support for Firefox

Currently missing:

  • BigInt (fixed in Firefox 69beta12)
  • CORS errors (fixed in Firefox 69beta12)

I have verified that once Firefox 69 is out, everything will work automatically.

Add support for Safari/iOS

Things missing so far:

Easiest way to enable iOS support is to include the following snippet:

<script src="https://peterolson.github.io/BigInteger.js/BigInteger.min.js"></script>
<script>
	if (navigator.userAgent.match(/iPhone/) || navigator.userAgent.match(/iPad/)) {
		function BigInt(value) {
			if ((typeof value) === "string" && value.slice(0, 2) === "0x") {
				return bigInt(value.slice(2), 16);
			}
			return bigInt(value);
		}
	}
</script>

It includes the BigInt polyfill and a compatibility layer that allows our SDK to utilize it.

install is full with warnings

Are we ok with all of these warnings, including "no such file or directory"?
`
npm WARN npm npm does not support Node.js v10.10.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN saveError ENOENT: no such file or directory, open '/Users/drortrieman/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/drortrieman/package.json'
npm WARN drortrieman No description
npm WARN drortrieman No repository field.
npm WARN drortrieman No README data
npm WARN drortrieman No license field.

add reference to block in transaction

the transaction object (result from {transactions} = await client.getBlock(x)) does not contain a reference to the enclosing block. this is lean but not easy to use for bulk transaction opertations where you'd like to pass the transaction object around with all. its relevant info.

should add a reference (either blockHeight integer, or a js reference to the GetBlockResponse object.

argument->build->protocol seems a bit complicated.

When we translate from Argument (src/codec/Arguments.ts func argumentsBuilders) to Builder (src/protocol/Protocol.ts ctor)
we take apart the arg and use switch over the type as string to create a builder where the type is number ... this seems unneeded ...
why not just push the switch over string into the builder ?

expose internal tools

It would help users if we export internal tools to them. my specific example currently is (addressToBytes and bytesToAddress).
this can happen in several ways:

  • selectively exporting the tools from the package root
  • not bundling the package before publication, thus empowering users to import stuff like orbs-client-sdk/dist/orbs/Account

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.