Skip to content

Commit

Permalink
Merge pull request #23 from peaqnetwork/feature/1207515694088907_sdk-…
Browse files Browse the repository at this point in the history
…feat-update

Feature/1207515694088907 sdk feat update
  • Loading branch information
jpgundrum authored Aug 30, 2024
2 parents 18768fc + 66efa9c commit 4b9e0ef
Show file tree
Hide file tree
Showing 13 changed files with 1,580 additions and 204 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# peaq-js

Follow [documentation](https://docs.peaq.network/sdk) for a detailed overview of the features and functionalities of peaq SDK.


## Edit functions
The SDK acts as a wrapper class that abstracts away calls to our substrate based blockchain

Go to /packages/sdk/src/modules to see backend code
- **main:** Creates an instance, connects/disconnects to chain, and stores metadata
- **base:** Stores important multi use variables and performs generic blockchain operations
- **did:** Class where did's are created, removed, read, and updated
- **rbac:** Class where role-based access control is called

## Test
1. Go to proper directory with cmd `cd packages/sdk`
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.
3. Run the tests with the cmd `npx nx test`
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peaq-network",
"version": "0.5.2",
"version": "0.6.0",
"license": "MIT",
"scripts": {
"prepare": "ts-patch install -s"
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "peaq network <[email protected]>",
"name": "@peaq-network/sdk",
"version": "0.5.2",
"version": "0.6.0",
"description": "peaq network sdk",
"license": "Apache-2.0",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion packages/sdk/src/modules/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export class Base {
if (!seed) {
throw new Error('Seed is required');
}
const keyring = new Keyring({ type: 'sr25519' });
const keyring = new Keyring({ ss58Format: 42, type: 'sr25519' });

return keyring.addFromUri(seed);
};

Expand Down
1,042 changes: 982 additions & 60 deletions packages/sdk/src/modules/did/did.spec.ts

Large diffs are not rendered by default.

Loading

0 comments on commit 4b9e0ef

Please sign in to comment.