@arkane-network/arkane-connect
Version:
Arkane Connect - api library for 3th parties
65 lines (64 loc) • 2.29 kB
TypeScript
import { EventTypes } from '../types/EventTypes';
export default class Utils {
private static rawEnvironmentHolder;
static environment: string;
static connectEnvironment: string;
static rawEnvironment: string;
static readonly env: {
CONNECT_JS_CLIENT_ID: string;
CONNECT_JS_REALM: string;
CONNECT_JS_SSL_REQUIRED: string;
CONNECT_JS_PUBLIC_CLIENT: string;
CONNECT_JS_INTERCOM_APP_ID: string;
};
static environments(): {
[key: string]: {
api: string;
connect: string;
login: string;
};
};
static readonly urls: {
api: string;
connect: string;
login: string;
};
static removeNulls(obj: any): any;
static removeNullsAndEmpty(obj: any): any;
static messages(): {
hasValidOrigin: (message: MessageEvent) => boolean;
hasType: (message: MessageEvent) => boolean;
isOfType: (message: MessageEvent, eventType: EventTypes) => boolean;
hasCorrectCorrelationID(message: MessageEvent, correlationID: string): boolean;
};
static formatNumber(value: number, minDecimals?: number, maxDecimals?: number): string;
static rawValue(): {
toTokenValue: (rawValue: number, decimals: number) => number;
toGwei: (rawValue: number) => number;
};
static gwei(): {
toRawValue: (rawValue: number) => number;
};
static openExternalUrl(url: string, targetBlank?: boolean): Window | null;
static zeroIfUndefined(numberToVerify?: number): number;
static defaultRedirectUriIfNotPresent(options?: {
redirectUri?: string;
correlationID?: string;
}): {
redirectUri?: string;
correlationID?: string;
};
static http(): {
postInForm: (to: string, request: any, bearerTokenProvider: () => string, options?: {
redirectUri?: string | undefined;
correlationID?: string | undefined;
} | undefined) => void;
buildUrl: (to: string, options?: {
redirectUri?: string | undefined;
correlationID?: string | undefined;
} | undefined) => string;
addRequestParams: (url: string, params: {
[key: string]: string;
}) => string;
};
}