RBKmoney Wallets Additional UI
Go to file
dependabot[bot] cca92ff9f9
Bump elliptic from 6.4.0 to 6.5.3 (#26)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.0 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.4.0...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-31 13:04:35 +03:00
build_utils@5cb25f049c Added security pipeline (#17) 2020-07-09 17:22:31 +03:00
config FE-603: init with config (#5) 2018-05-18 19:37:57 +03:00
src FE-640: replace part of initializer with cross-origin-communicator li… (#14) 2018-08-15 13:50:02 +03:00
.gitignore FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
.gitmodules FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
containerpilot.json FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
Dockerfile.sh FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
Jenkinsfile Added security pipeline (#17) 2020-07-09 17:22:31 +03:00
LICENSE Let's make it opensource (#16) 2019-09-20 00:29:58 +03:00
Makefile Added security pipeline (#17) 2020-07-09 17:22:31 +03:00
nginx.conf FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
package-lock.json Bump elliptic from 6.4.0 to 6.5.3 (#26) 2020-08-31 13:04:35 +03:00
package.json Bump webpack-bundle-analyzer from 2.10.1 to 3.3.2 (#25) 2020-08-31 13:04:11 +03:00
README.md Renamed Output 2 Destination (#13) 2018-08-03 16:20:02 +03:00
tsconfig.json FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
tslint.json FE-606: identity flow (#8) 2018-06-13 18:28:54 +03:00

wallet-utils

API

Type definition

declare class RbkmoneyWalletUtils {

    constructor(token: string);

    startIdentityChallenge(params: StartIdentityChallengeParams): void;

    createDestination(params: CreateDestinationsParams): void;

    abort(): void;

    onCompleteIdentityChallenge(event: IdentityChallengeEvent) => void;

    onFailIdentityChallenge(event: IdentityChallengeEvent) => void;

    onCancelIdentityChallenge(event: IdentityChallengeEvent) => void;

    onCreateDestination(event: CreateDestinationEvent) => void;

    onCancel(event: CancelEvent) => void;
}

declare interface StartIdentityChallengeParams {
    identityID: string;
    level?: IdentityLevel;
}

declare enum IdentityLevel {
    partial = 'partial'
}

declare interface CreateDestinationParams {
    identityID: string;
    name: string;
}

declare interface WalletUtilsEvent {
    target: RbkmoneyWalletUtils;
}

declare interface IdentityChallengeEvent extends WalletUtilsEvent {
    identityChallenge: IdentityChallenge;
}

declare interface CreateDestinationEvent extends WalletUtilsEvent {
    destination: Destination;
}

declare interface CancelEvent extends WalletUtilsEvent {
    type: CancelEventType;
}

declare enum CancelEventType {
    uiDismissing: 'uiDismissing',
    error: 'error'
}

declare interface ErrorCancelEvent extends CancelEvent {
    error: LogicError;
}

declare interface LogicError {
    code: string;
    message: string;
}

declare type IdentityChallenge = any; // see swagger definition

declare type Destination = any; // see swagger definition

Usage

const walletUtils = new RbkmoneyWalletUtils('<jwt token>');

walletUtils.startIdentityChallenge({
    identityID: '<string>'
});

walletUtils.onCompleteIdentityChallenge = (event) => {
    // handle user complete identity challenge
};

walletUtils.onFailIdentityChallenge = (event) => {
    // handle user failed identity challenge
};

walletUtils.onCancel = (event) => {
    // handle UI dismissing
};