Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit cfa652e

Browse files
authored
Merge pull request #37 from quantnetwork/develop
Aligning with V2.1.1 npm release
2 parents e74fc01 + 6d15193 commit cfa652e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5849
-6643
lines changed

.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
USER_NAME=EXAMPLE_USER
2-
3-
CLIENT_ID=your-client-id-here
4-
CLIENT_SECRET=your-client-secret-here
1+
USER_NAME=your-overledger-devportal-email-address-here
2+
PASSWORD=your-overledger-devportal-password-here
3+
CLIENT_ID=your-overledger-devportal-application-client-id-here
4+
CLIENT_SECRET=your-overledger-devportal-application-client-secret-here
55

66
PARTY_A_BITCOIN_PRIVATE_KEY=cNmsFjPqWCaVdhbPoHQJqDpayYdtKR9Qo81KVAEMHJwmgRVJZjDu
77
PARTY_A_ETHEREUM_PRIVATE_KEY=e352ad01a835ec50ba301ed7ffb305555cbf3b635082af140b3864f8e3e443d3

.github/workflows/node.js.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ on:
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
15-
15+
environment: OverledgerCTA
16+
env:
17+
PASSWORD: ${{ secrets.PASSWORD }}
18+
USER_NAME: ${{ secrets.USER_NAME }}
19+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
20+
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
1621
strategy:
1722
matrix:
1823
node-version: [10.22.0, 12.13.0, 14.15.0, 16.1.0]

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ node_modules/
22
/packages/*/node_modules
33
dist/
44
yarn.lock
5+
.env.enc
6+
/examples/create-account/.env.enc
7+
/examples/oauth2/.env.enc
8+
/examples/signing/.env.enc
9+
*/.env.enc
510
/packages/*/dist
11+
~/.nvm
12+
613

714
*DS_STORE

README.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,49 @@ Welcome to the developer's guide to use the Overledger SDK written in Javascript
44

55
## Introduction to the Overledger SDK
66

7-
Overledger is a REST API that allows applications to connect to multiple distributed ledger technologies (DLTs) or blockchains through the use of a standardised interface. The Overledger SDK enables developers to create signed transactions and send them to the supported DLTs.
7+
Overledger is a REST API that allows applications to connect to multiple distributed ledger technologies (DLTs) or blockchains through the use of a standardised interface.
8+
9+
The Overledger SDK enables developers to create blockchain accounts, create signed transactions and refresh Overledger access tokens.
810

911
## Technologies
1012

11-
The Overledger SDK is a collection of node packages written in Typescript. Currently, the supported DLTs are Bitcoin, Ethereum and Ripple.
13+
The Overledger SDK is a collection of node packages written in Typescript. Currently, the supported DLTs are Bitcoin, Ethereum and the XRP Ledger.
1214

1315
## Prerequisites
1416

15-
- nodejs 10
17+
- nodejs v10 >= 10.22.0, or v12 >= 12.13.0, or v14 >= 14.15.0, or >= v15
1618
- yarn
1719
- lerna
1820

1921
## Installation
2022

21-
Currently, v2 of the Overledger SDK is not published on NPM or Yarn. Thus, we have to build it on our machine before using it in our own projects.
23+
The Overledger SDK can be installed as node modules.
24+
25+
If all supported Distributed Ledger Technologies (DLTs) are necessary, the bundle package can be installed, which will include all the required dependencies.
26+
27+
```
28+
npm install @quantnetwork/overledger-bundle
29+
```
30+
31+
Or, if you prefer using [yarn](https://yarnpkg.com/):
32+
33+
```
34+
yarn add @quantnetwork/overledger-bundle
35+
```
36+
37+
Alternatively, the suite of node packages allows developers to chose which DLTs they would like to utilise by installing the core overledger package and the individual DLT packages. For example, if you only want to use the Ethereum blockchain, you will need only the overledger-core and overledger-ethereum packages, which you can install via:
38+
39+
```
40+
npm install @quantnetwork/overledger-core
41+
npm install @quantnetwork/overledger-dlt-ethereum
42+
```
43+
44+
Or, if you prefer using [yarn](https://yarnpkg.com/):
2245

23-
The Overledger SDK can be installed as a node module. If all supported DLTs are necessary,
24-
the overledger-bundle package can be installed, which will include all required dependencies.
46+
```
47+
yarn add @quantnetwork/overledger-core
48+
yarn add @quantnetwork/overledger-dlt-ethereum
49+
```
2550

2651
#### Building
2752

@@ -37,7 +62,7 @@ To build the project, first download the yarn package manager:
3762
npm install -g yarn
3863
```
3964

40-
Then, we can run run:
65+
Then, we can run build:
4166

4267
```
4368
yarn run build
@@ -46,7 +71,8 @@ yarn run build
4671
>Note: For Windows users, please use git bash as the build currently uses UNIX-based commands. You will also need to make sure you have 'make' installed for windows. This is done by running powershell first as Administrator and then installing make with chocolatey: ```choco install make```
4772
4873
This will build and link the packages together.
49-
To test if the package built correctly, you can run
74+
75+
To test if the package built correctly, you can run:
5076

5177
```
5278
yarn run test
@@ -57,20 +83,20 @@ yarn run test
5783
After building, you can install it in your own project. Make sure to specify the version if you'd like to use this version of the SDK vs the public one from NPM.
5884

5985
```
60-
npm install @quantnetwork/overledger-bundle@2.0.0
86+
npm install @quantnetwork/overledger-bundle@2.1.1
6187
```
6288

6389
Or, if you prefer using [yarn](https://yarnpkg.com/):
6490

6591
```
66-
yarn add @quantnetwork/overledger-bundle@2.0.0
92+
yarn add @quantnetwork/overledger-bundle@2.1.1
6793
```
6894

69-
Alternatively, the suite of packages allows developers to chose which blockchains/DLTs they would like to utilise by installing the core package and the individual DLT packages. Such as if you only want to install overledger-core and overledger-ethereum you would enter:
95+
Alternatively, the suite of packages allows developers to chose which DLTs they would like to utilise by installing the core package and the individual DLT packages. For example, if you only want to use the Ethereum blockchain, you will need only the overledger-core and overledger-ethereum packages, which you can install via:
7096

7197
```
72-
npm install @quantnetwork/overledger-core@2.0.0
73-
npm install @quantnetwork/overledger-dlt-ethereum@2.0.0
98+
npm install @quantnetwork/overledger-core@2.1.1
99+
npm install @quantnetwork/overledger-dlt-ethereum@2.1.1
74100
```
75101

76102
Or, if you prefer using [yarn](https://yarnpkg.com/):
@@ -80,20 +106,16 @@ yarn add @quantnetwork/overledger-core
80106
yarn add @quantnetwork/overledger-dlt-ethereum
81107
```
82108

83-
84-
85109
## Getting started
86110

87-
To get started, you can take a look at the examples folder for common use cases. There is a README file with detailed instructions in the signing example.
111+
To get started, you can take a look at the examples folder for basic use cases. For more complicated use cases, please explore our Overledger demo application github [here](https://github.com/quantnetwork/quant-demo-application).
88112

89113
## API Reference
90114

91-
The SDK packages provide functions for interacting with the Overledger API Gateway as well as support for offline account generation and transaction signing.
92-
The functions which interact with the Overledger API (send, get) return a promise with a standard Axios response which includes the BPI data in the `data` field.
93-
94-
Please check the examples folder for details on how to sign and send transactions, as well as do account queries. The sdk reference page can be found [here](api_reference.md).
115+
The SDK packages provide functions for interacting with some of the Overledger API Gateway as well as support for offline account generation and transaction signing.
116+
The functions which interact with the Overledger API (get, post) return a promise with a standard Axios response which includes the BPI data in the `data` field.
95117

96-
The Overledger API Swagger docs can be found here: https://api.sandbox.overledger.io/v2/documentation/swagger-ui.html
118+
The full Overledger API Swagger docs can be found [here](https://docs.overledger.io/).
97119

98120
## Development
99121

api_reference.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ Set an account for signing transactions for a specific DLT
466466

467467
* [.setAccount(accountInfo)](#Ripple+setAccount)
468468

469+
* [.isValidSeed()](#Ripple+isValidSeed)
470+
469471

470472
<a name="new_Ripple_new"></a>
471473

@@ -501,6 +503,11 @@ Create an XRP account
501503

502504
Set an account for signing for a specific DLT
503505

506+
<a name="Ripple+isValidSeed"></a>
507+
508+
### *ripple*.isValidSeed()
509+
ripple seed validation
510+
504511
<a name="Provider"></a>
505512

506513
## Provider

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PARTY_A_ETHEREUM_PRIVATE_KEY=e352ad01a835ec50ba301ed7ffb305555cbf3b635082af140b3
3333
PARTY_A_XRP_LEDGER_PRIVATE_KEY=sswERuW1KWEwMXF6VFpRY72PxfC9b
3434
```
3535

36-
Once you have created this file, you will need to secure it with "secure-env".
36+
Once you have created this file, you will need to secure it by using "secure-env". To do so, you should install this program via:
3737

3838
```
3939
npm install -g secure-env

examples/create-account/create-account.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//NOTE: Please create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE.
22
//Run: secure-env .env -s mySecretPassword
33
//You will then get a .env.enc file created in your project root directory. You can delete the .env file after this to prevent stealing.
4-
//pass in the password in OverledgerSdk
4+
//pass in the password of the .env.enc file in OverledgerSdk
55
//
66

7-
//NOTE: You may need to run "yarn install" inside the examples/create-account folder, then node create-account.js
8-
//NOTE: replace @quantnetwork/ with ../../packages/ for all require statements below if you have not built the SDK yourself
7+
//NOTE: replace @quantnetwork/ with ../../packages/ for all require statements below if you have built the SDK yourself
98
const OverledgerSDK = require('@quantnetwork/overledger-bundle').default;
109
const DltNameOptions = require('@quantnetwork/overledger-types').DltNameOptions;
1110

examples/get-echo/get-echo.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/keytool/create-keystore-file.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/keytool/generate-cert.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)