-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
130 changed files
with
37,257 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"env": { | ||
"development": { | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"modules": false, | ||
"targets": { | ||
"chrome": 67 | ||
} | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
"transform-object-rest-spread" | ||
] | ||
}, | ||
"production": { | ||
"presets": [ | ||
[ | ||
"env", | ||
{ | ||
"modules": false | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
"transform-object-rest-spread", | ||
["transform-runtime", { | ||
"regenerator": true | ||
}] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
node_modules | ||
/.project | ||
/.settings/ | ||
|
||
|
||
/docs/_build/ | ||
lib/ | ||
|
||
# Logs | ||
*.log | ||
|
||
# Coverage | ||
/.nyc_output | ||
/coverage | ||
|
||
# IDE specific | ||
/.vscode | ||
|
||
/.DS_Store | ||
src/.DS_Store | ||
|
||
apidoc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
src/ | ||
node_modules/ | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Contributing | ||
========================================= | ||
|
||
We welcome contributions. Please follow the guidelines when opening issues and contributing code to the repo. | ||
|
||
Contributing | ||
------------ | ||
|
||
We follow the [fork-and-pull](https://stackoverflow.com/a/11582996/3830876) Git workflow: | ||
|
||
1. **Fork** the repo on GitHub | ||
2. **Clone** it to your own machine | ||
3. **Commit** changes to your fork | ||
4. **Push** changes to your fork | ||
5. Submit a **Pull request** for review | ||
|
||
**NOTE:** Be sure to merge the latest changes before making a pull request! | ||
|
||
Pull Requests | ||
------ | ||
As outlined in Keavy McMinn's article ["How to write the perfect pull request"](https://github.blog/2015-01-21-how-to-write-the-perfect-pull-request/), you should include: | ||
|
||
1. The purpose of the PR | ||
2. A brief overview of what you did | ||
3. Tag any issues that the PR relates to and [close issues with a keyword](https://help.github.com/en/articles/closing-issues-using-keywords) | ||
4. What kind of feedback you're looking for (if any) | ||
5. Tag individuals you want feedback from (if any) | ||
|
||
Issues | ||
------ | ||
|
||
Feel free to submit issues and enhancement requests [here](https://github.com/ontio/DNA-ts-sdk/issues/new). Please consider [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and take the time to research your issue before asking for help. | ||
|
||
Duplicate questions will be closed. | ||
|
||
Any unrelated comments or questions can be asked in the [DNA Discord](https://discordapp.com/invite/4TQujHj). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
|
||
<h1 align="center">DNA TypeScript SDK </h1> | ||
<h4 align="center">Version V1.1.0 </h4> | ||
|
||
- [Overview](#overview) | ||
- [Installation](#installation) | ||
- [Download Through npm/Yarn](#download-through-npmyarn) | ||
- [Build from Source Code](#build-from-source-code) | ||
- [Downloading](#downloading) | ||
- [Compiling](#compiling) | ||
- [Testing](#testing) | ||
- [Use in Project](#use-in-project) | ||
- [Import](#import) | ||
- [Require](#require) | ||
- [In the Browser](#in-the-browser) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
|
||
## Overview | ||
|
||
This is the official DNA TypeScript SDK - a comprehensive library for developing with the DNA blockchain in both TypeScript and JavaScript. It currently supports management of wallets, digital identities and digital assets - as well as the deployment and invocation of smart contracts. | ||
|
||
## Installation | ||
|
||
### Download Through npm/Yarn | ||
|
||
```` | ||
npm install 'dna-ts-sdk' --save | ||
```` | ||
|
||
or | ||
|
||
``` | ||
yarn add 'dna-ts-sdk' | ||
``` | ||
|
||
### Build from Source Code | ||
|
||
#### Downloading | ||
|
||
``` | ||
git clone 'https://github.com/DNAProject/DNA-ts-SDK.git' | ||
``` | ||
|
||
Then install the dependencies with: | ||
|
||
``` | ||
npm install | ||
``` | ||
|
||
or | ||
|
||
``` | ||
yarn | ||
``` | ||
|
||
#### Compiling | ||
|
||
Compile the project with the: | ||
|
||
```` | ||
npm run build:dev // or npm run build:prod | ||
```` | ||
|
||
or | ||
|
||
``` | ||
yarn run build:dev // or yarn run build:prod | ||
``` | ||
|
||
This will create a compiled version of the SDK in the `lib` directory. | ||
|
||
#### Testing | ||
|
||
To run the tests in the `test` directory, use: | ||
|
||
``` | ||
npm run test | ||
``` | ||
|
||
or | ||
|
||
``` | ||
yarn run test | ||
``` | ||
|
||
### Use in Project | ||
|
||
#### Import | ||
|
||
Using `import` to include the modules from `'DNA-ts-sdk'`: | ||
|
||
``` | ||
import {Wallet} from 'DNA-ts-sdk'; | ||
var wallet = Wallet.create('test'); | ||
``` | ||
|
||
#### Require | ||
|
||
Using `require` to include the modules from `'DNA-ts-sdk'`: | ||
|
||
```` | ||
var DNA = require('DNA-ts-sdk'); | ||
var wallet = DNA.Wallet.create('test'); | ||
```` | ||
|
||
#### In the Browser | ||
|
||
To use in the browser you must use the compiled version (as listed above). | ||
The `browser.js` file is located in the `lib` directory. | ||
Include it into the project with a `<script>` tag: | ||
|
||
```` | ||
<script src="./lib/browser.js"></script> | ||
```` | ||
|
||
Everything will be available under the `DNA` variable, just like in the `require` example above. | ||
|
||
``` | ||
var wallet = DNA.Wallet.create('test'); | ||
``` | ||
|
||
## Contributing | ||
|
||
Contributors are welcome to the `DNA-ts-sdk`. Before beginning, please take a look at our [contributing guidelines](CONTRIBUTING.md). You can open an issue by [clicking here](https://github.com/DNAProject/DNA-ts-sdk/issues/new). | ||
|
||
## License | ||
|
||
The DNA TypeScript SDK is availabl under the [LGPL-3.0 License](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
transform: { | ||
"^.+\\.tsx?$": "ts-jest", | ||
}, | ||
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], | ||
}; |
Oops, something went wrong.