RBKmoney Wallets Additional UI
Go to file
2018-05-11 14:59:03 +03:00
build_utils@f7fe66c9f3 FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
config FE-599: added passport-form (#4) 2018-05-11 14:59:03 +03:00
src FE-599: added passport-form (#4) 2018-05-11 14:59:03 +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 FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
Makefile FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
nginx.conf FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
package-lock.json FE-599: added passport-form (#4) 2018-05-11 14:59:03 +03:00
package.json FE-599: added passport-form (#4) 2018-05-11 14:59:03 +03:00
README.md FE-600: Wallet utils API definition. (#2) 2018-04-26 18:24:24 +03:00
tsconfig.json FE-598: Initial config (#1) 2018-04-20 18:26:12 +03:00
tslint.json FE-599: added passport-form (#4) 2018-05-11 14:59:03 +03:00

wallet-utils

API

Type definition

declare class RbkmoneyWalletUtils {

    constructor(token: string);

    startIdentityChallenge(params: StartIdentityChallengeParams): void;

    createOutput(params: CreateOutputParams): void;

    abort(): void;

    onCompleteIdentityChallenge(event: IdentityChallengeEvent) => void;

    onFailIdentityChallenge(event: IdentityChallengeEvent) => void;

    onCancelIdentityChallenge(event: IdentityChallengeEvent) => void;

    onCreateOutput(event: CreateOutputEvent) => void;

    onCancel(event: CancelEvent) => void;
}

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

declare enum IdentityLevel {
    partial = 'partial'
}

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

declare interface WalletUtilsEvent {
    target: RbkmoneyWalletUtils;
}

declare interface IdentityChallengeEvent extends WalletUtilsEvent {
    identityChallenge: IdentityChallenge;
}

declare interface CreateOutputEvent extends WalletUtilsEvent {
    output: Output;
}

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 Output = 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
};