Skip to content

Commit 4b9e0ef

Browse files
authored
Merge pull request #23 from peaqnetwork/feature/1207515694088907_sdk-feat-update
Feature/1207515694088907 sdk feat update
2 parents 18768fc + 66efa9c commit 4b9e0ef

File tree

13 files changed

+1580
-204
lines changed

13 files changed

+1580
-204
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
# peaq-js
22

33
Follow [documentation](https://docs.peaq.network/sdk) for a detailed overview of the features and functionalities of peaq SDK.
4+
5+
6+
## Edit functions
7+
The SDK acts as a wrapper class that abstracts away calls to our substrate based blockchain
8+
9+
Go to /packages/sdk/src/modules to see backend code
10+
- **main:** Creates an instance, connects/disconnects to chain, and stores metadata
11+
- **base:** Stores important multi use variables and performs generic blockchain operations
12+
- **did:** Class where did's are created, removed, read, and updated
13+
- **rbac:** Class where role-based access control is called
14+
15+
## Test
16+
1. Go to proper directory with cmd `cd packages/sdk`
17+
2. Create a .env file in `packages/sdk` to store the base_url (network) you are testing, and seed phrases that connect to funded wallets that are needed to execute transactions.
18+
3. Run the tests with the cmd `npx nx test`

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "peaq-network",
3-
"version": "0.5.2",
3+
"version": "0.6.0",
44
"license": "MIT",
55
"scripts": {
66
"prepare": "ts-patch install -s"

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "peaq network <[email protected]>",
33
"name": "@peaq-network/sdk",
4-
"version": "0.5.2",
4+
"version": "0.6.0",
55
"description": "peaq network sdk",
66
"license": "Apache-2.0",
77
"repository": {

packages/sdk/src/modules/base/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export class Base {
4747
if (!seed) {
4848
throw new Error('Seed is required');
4949
}
50-
const keyring = new Keyring({ type: 'sr25519' });
50+
const keyring = new Keyring({ ss58Format: 42, type: 'sr25519' });
51+
5152
return keyring.addFromUri(seed);
5253
};
5354

packages/sdk/src/modules/did/did.spec.ts

Lines changed: 982 additions & 60 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)