endless-luffa-sdk
Version:
luffa endless ts sdk
87 lines (84 loc) • 2.47 kB
text/typescript
import { Network, Signature, InputGenerateTransactionPayloadData, InputGenerateTransactionOptions } from 'endless-ts-sdk';
type IInitData = {
colorMode?: 'light' | 'dark';
network: Network;
fullnode?: string;
indexer?: string;
walletUrl?: string;
prover?: string;
miniprogram?: Boolean;
windowWidth?: number;
};
declare enum UserResponseStatus {
APPROVED = "Approved",
REJECTED = "Rejected"
}
interface UserApproval<TResponseArgs> {
status: UserResponseStatus.APPROVED;
args: TResponseArgs;
}
interface UserRejection {
status: UserResponseStatus.REJECTED;
message?: string;
}
type UserResponse<TResponseArgs> = UserApproval<TResponseArgs> | UserRejection;
interface AccountInfo {
account: string;
address: string;
authKey: string;
ansName?: string;
}
interface NetworkInfo {
name: Network;
chainId: number;
url?: string;
}
type EndlessSignMessageInput = {
address?: boolean;
application?: boolean;
chainId?: boolean;
message: string;
nonce?: string;
};
type EndlessSignMessageOutput = {
address?: string;
application?: string;
chainId?: number;
fullMessage: string;
publicKey: string;
message: string;
nonce: string;
prefix: 'Endless';
signature: Signature;
};
interface EndlessSignAndSubmitTransactionInput {
gasUnitPrice?: number;
maxGasAmount?: number;
payload: InputGenerateTransactionPayloadData;
options?: InputGenerateTransactionOptions;
}
declare enum EndlessSendTransactionType {
SIGNATURE_ONLY = "signatureOnly",
SIGN_AND_SUBMIT = "signAndSubmit"
}
declare enum EndlessWalletTransactionType {
SIMPLE = "simple",
MULTI_AGENT = "multiAgent"
}
declare global {
interface Window {
wx: any;
webkit: any;
WeixinJSBridge: {
invoke(api: string, data: any, callback: (res: any) => void): void;
on(api: string, callback: (res: any) => void): void;
};
endlessWallet?: {
sendResponse: (response: any) => void;
};
_endlessWallet?: {
sendMessage: (data: any) => void;
};
}
}
export { type AccountInfo, EndlessSendTransactionType, type EndlessSignAndSubmitTransactionInput, type EndlessSignMessageInput, type EndlessSignMessageOutput, EndlessWalletTransactionType, type IInitData, type NetworkInfo, type UserApproval, type UserRejection, type UserResponse, UserResponseStatus };