-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSUB-256: Document Creditcoin-JS #1348
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1348 +/- ##
==========================================
- Coverage 70.83% 70.17% -0.66%
==========================================
Files 107 107
Lines 12411 12506 +95
Branches 120 120
==========================================
- Hits 8791 8776 -15
- Misses 3610 3730 +120
+ Partials 10 0 -10 see 13 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
For full LLVM coverage report click here! |
Converted to Draft to avoid merging accidentally before we're sure we want to do this (or publish the package to NPM in the mean time). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions and change requests added.
Creditcoin-js requires the following to be installed: | ||
|
||
- [Node.js](https://nodejs.org/en/) | ||
- [TypeScript](https://www.typescriptlang.org/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we install typescript with yarn ?
I would add yarn
as a requirement here tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about TypeScript being listed as prerequisite? I think it will be installed by yarn so no need to mention it explicitly, no ?
const keyring = new Keyring({ type: 'sr25519' }); | ||
const alice = keyring.addFromUri('//Alice'); | ||
|
||
await tx.signAndSend(alice); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit ambiguous (the tx
variable I mean). I had to scroll back and read the example above to figure out that both snippets are connected.
Maybe highlight this connection somehow. A big fat warning or a full example with individual sections as comments is the only thing I can think off. The latter having the benefit that we can move it into a file and exercise it via CI.
47aea78
to
24120c2
Compare
**WARNING**: This is an alpha version of creditcoin-js. It is not ready for production use. It will have breaking changes often. | ||
## Getting started | ||
|
||
### Preqrequisites |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Preqrequisites | |
### Prerequisites |
import { CreditcoinApi, creditcoinApi } from 'creditcoin-js'; | ||
import { transferExample } from 'creditcoin-js/lib/examples/transfer'; | ||
|
||
describe('creditcoin js examples', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the hard-coded address below I think this only needs to be executed when running against a local network. You can use describeIf
and/or testIf
from ../utils
and make execution conditional based on the URL for example.
Then you can remove the usage of global config values from the example itself.
Description of proposed changes
CONSIDER BEFORE MERGING: Until the package is published in NPM, installation guide will be misguiding
This PR:
alpha
warning from READMEcreditcoin-js
is published on npm unscoped)This PR does not:
Practical tips for PR review & merge: