@make-software/csprclick-core-client
Version:
CSPR.click core client package for web applications
74 lines (73 loc) • 1.82 kB
TypeScript
import { CONTENT_MODE } from '@make-software/csprclick-core-types';
export declare const CSPRCLICK_HOST: string;
export type WalletConnectSettings = {
projectId: string;
relayUrl?: string;
logger?: string;
};
export type CsprClickInitOptions = {
csprclickHost?: string;
appName: string;
appId: string;
contentMode: CONTENT_MODE;
providers: Array<string>;
jwt?: boolean;
casperNode?: string;
chainName?: string;
walletConnect?: WalletConnectSettings;
logLevel?: number;
};
export type WalletEventData = {
provider: string;
providerSupports: string[];
providerEvent: string;
activeKey: string | null;
connected: boolean | null;
unlocked: boolean | null;
custom: any;
};
export type SignResult = {
cancelled: boolean;
signatureHex: null | string;
signature: Uint8Array | null;
deploy: object | null;
transaction: object | null;
error: string | null;
};
export type SendResult = {
cancelled: boolean;
deployHash: string | null;
transactionHash: string | null;
status: string | null;
error: string | null;
errorData: object | null;
csprCloudTransaction: any;
};
export type GetActiveAccountOptions = {
withBalance?: boolean;
withFiatCurrency?: string;
};
export type AccountMetadata = {
public_key: string;
liquid_balance: string;
total_balance: string;
account_logo: string | null;
cspr_name: string | null;
fiat_cspr_rate: number;
fiat_currency: string;
};
export type CoreClientError = {
code: number;
message: string;
data?: any;
};
export type CloudProxyError = {
code: number;
message: string;
};
export type CsprCloudProxyResponse = {
status: number;
statusText: string;
error: CloudProxyError | null;
data: object;
};