/portkey-web

Typescript SDKs for developers to create our own app with portkey did solution/protocol.

Primary LanguageTypeScriptMIT LicenseMIT

portkey-web

CI

Statements Branches Functions Lines
Statements Branches Functions Lines

Packages

Package Version Size Link
@portkey/did npm minzip
@portkey/accounts npm minzip
@portkey/contracts npm minzip
@portkey/graphql npm minzip
@portkey/request npm minzip
@portkey/services npm minzip
@portkey/types npm minzip
@portkey/utils npm minzip
@portkey/validator npm minzip
@portkey/socket npm minzip
UI Packages
@portkey/did-ui-react npm minzip

Get start

for users

Program start

yarn

# build packages
yarn build

# try to run test
yarn test

How to program in the portkey sdk

Write you interface and test case at first.

For example, if we want to run did.init();

// first step
// in interface files
export interface IDid {
  init(): boolean;
}
// second step
// intest files list did.test.ts
describe('did', () => {
  test('did init', () => {
    expect(did.init()).resolves.toBeTrue(); // true
  });
});

// third step
// implement the interface
class Did implements IDid {
  init() {
    return true;
  }
}
# run your test
npx jest ./packages/did/test/did.test.ts
# if passed, success

Loop the steps to get an awesome program.

IoC

@injectable()
class Did implements IDid {
  init() {
    return true;
  }
}

Node: jest will help us to write a better program with ioc.