npm.io
1.3.0 • Published 4 years ago

amogus-driver

Licence
BSD-3-Clause
Version
1.3.0
Deps
1
Size
85 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

License Version Coverage Downloads PRs and issues

AMOGUS wire protocol implementation

This library provides an AMOGUS implementation for JS and TS in all major environments (browser, node, etc.). Install it with:

npm i amogus-driver

If you're using a BigInt polyfill, add this as close to the entry as possible:

import * as amogus from "amogus-driver";

// if using a polyfill that provides a BigInt(string, radix) constructor
// (e.g. 'big-integer', 'bigint-polyfill'):
amogus.repr.BigInteger.polyfillMode = "radix";

// if using a polyfill that supports BigInt("0x<data>"):
amogus.repr.BigInteger.polyfillMode = "0x";

// if not using a polyfill or using a polyfill that implements
// operators like native BigInts (haven't seen one of those in
// the wild):
amogus.repr.BigInteger.polyfillMode = "none";
// OR don't do anything, this is the default value

How do I use it??

There's a complete tutorial over here.

Testing

Warning: this repository uses a pnpm lock file, hence you can't substitute it for npm below.

git clone https://github.com/amogus-api/driver-ts
cd driver-ts
pnpm i
pip3 install susc
pnpm test