///
import { ChainInfo, EthSignType, Keplr as IKeplr, KeplrIntereactionOptions, KeplrMode, KeplrSignOptions, Key, BroadcastMode, AminoSignResponse, StdSignDoc, StdTx, OfflineAminoSigner, StdSignature, DirectSignResponse, OfflineDirectSigner, ICNSAdr36Signatures, ChainInfoWithoutEndpoints, SecretUtils, SettledResponses, DirectAuxSignResponse, IEthereumProvider, IStarknetProvider, WalletEvents, SupportedPaymentType, IBitcoinProvider, Network as BitcoinNetwork, BitcoinSignMessageType, ChainType as BitcoinChainType, SignPsbtOptions, Inscription } from "@keplr-wallet/types";
import { MessageRequester } from "@keplr-wallet/router";
import Long from "long";
import { KeplrCoreTypes } from "./core-types";
import EventEmitter from "events";
import type { AccountInterface, Call, DeployAccountSignerDetails, InvocationsSignerDetails, ProviderInterface } from "starknet";
export declare class Keplr implements IKeplr, KeplrCoreTypes {
readonly version: string;
readonly mode: KeplrMode;
protected readonly requester: MessageRequester;
protected enigmaUtils: Map;
defaultOptions: KeplrIntereactionOptions;
constructor(version: string, mode: KeplrMode, requester: MessageRequester);
ping(): Promise;
enable(chainIds: string | string[]): Promise;
isEnabled(chainIds: string | string[]): Promise;
disable(chainIds?: string | string[]): Promise;
experimentalSuggestChain(chainInfo: ChainInfo & {
gasPriceStep?: {
readonly low: number;
readonly average: number;
readonly high: number;
};
}): Promise;
getKey(chainId: string): Promise;
getKeysSettled(chainIds: string[]): Promise>;
getChainInfosWithoutEndpoints(): Promise;
getChainInfoWithoutEndpoints(chainId: string): Promise;
sendTx(chainId: string, tx: StdTx | Uint8Array, mode: BroadcastMode): Promise;
signAmino(chainId: string, signer: string, signDoc: StdSignDoc, signOptions?: KeplrSignOptions): Promise;
signDirect(chainId: string, signer: string, signDoc: {
bodyBytes?: Uint8Array | null;
authInfoBytes?: Uint8Array | null;
chainId?: string | null;
accountNumber?: Long | null;
}, signOptions?: KeplrSignOptions): Promise;
signDirectAux(chainId: string, signer: string, signDoc: {
bodyBytes?: Uint8Array | null;
publicKey?: {
typeUrl: string;
value: Uint8Array;
} | null;
chainId?: string | null;
accountNumber?: Long | null;
sequence?: Long | null;
}, signOptions?: Exclude): Promise;
signArbitrary(chainId: string, signer: string, data: string | Uint8Array): Promise;
verifyArbitrary(chainId: string, signer: string, data: string | Uint8Array, signature: StdSignature): Promise;
signFigureMarketsAuth(chainId: string, signer: string, message: string): Promise<{
signedMessage: string;
signature: StdSignature;
}>;
signDirectWithMessages(chainId: string, signer: string, messages: string[], signDirectWithMessagesOptions: {
memo?: string;
sync?: boolean;
timeoutHeight?: number;
gasAdjustment?: number;
}): Promise<{
txHash: string;
}>;
signEthereum(chainId: string, signer: string, message: string | Uint8Array, signType: EthSignType): Promise;
signICNSAdr36(chainId: string, contractAddress: string, owner: string, username: string, addressChainIds: string[]): Promise;
getOfflineSigner(chainId: string, signOptions?: KeplrSignOptions): OfflineAminoSigner & OfflineDirectSigner;
getOfflineSignerOnlyAmino(chainId: string, signOptions?: KeplrSignOptions): OfflineAminoSigner;
getOfflineSignerAuto(chainId: string, signOptions?: KeplrSignOptions): Promise;
suggestToken(chainId: string, contractAddress: string, viewingKey?: string): Promise;
getSecret20ViewingKey(chainId: string, contractAddress: string): Promise;
getEnigmaPubKey(chainId: string): Promise;
getEnigmaTxEncryptionKey(chainId: string, nonce: Uint8Array): Promise;
enigmaEncrypt(chainId: string, contractCodeHash: string, msg: object): Promise;
enigmaDecrypt(chainId: string, cipherText: Uint8Array, nonce: Uint8Array): Promise;
getEnigmaUtils(chainId: string): SecretUtils;
experimentalSignEIP712CosmosTx_v0(chainId: string, signer: string, eip712: {
types: Record;
domain: Record;
primaryType: string;
}, signDoc: StdSignDoc, signOptions?: KeplrSignOptions): Promise;
__core__getAnalyticsId(): Promise;
changeKeyRingName({ defaultName, editable, }: {
defaultName: string;
editable?: boolean;
}): Promise;
getAllWallets(): Promise<{
id: string;
name: string;
isSelected: boolean;
addresses: {
[chainId: string]: string;
};
}[]>;
switchAccount(id: string): Promise;
__core__privilageSignAminoWithdrawRewards(chainId: string, signer: string, signDoc: StdSignDoc): Promise;
__core__privilageSignAminoDelegate(chainId: string, signer: string, signDoc: StdSignDoc): Promise;
__core__privilageSignAminoExecuteCosmWasm(chainId: string, signer: string, signDoc: StdSignDoc): Promise;
sendEthereumTx(chainId: string, tx: Uint8Array): Promise;
suggestERC20(chainId: string, contractAddress: string): Promise;
__core__webpageClosed(): Promise;
getStarknetKey(chainId: string): Promise<{
name: string;
hexAddress: string;
pubKey: Uint8Array;
address: Uint8Array;
isNanoLedger: boolean;
}>;
getStarknetKeysSettled(chainIds: string[]): Promise>;
signStarknetTx(chainId: string, transactions: Call[], details: InvocationsSignerDetails): Promise<{
transactions: Call[];
details: InvocationsSignerDetails;
signature: string[];
}>;
signStarknetDeployAccountTransaction(chainId: string, transaction: DeployAccountSignerDetails): Promise<{
transaction: DeployAccountSignerDetails;
signature: string[];
}>;
getBitcoinKey(chainId: string): Promise<{
name: string;
pubKey: Uint8Array;
address: string;
paymentType: SupportedPaymentType;
isNanoLedger: boolean;
}>;
getBitcoinKeysSettled(chainIds: string[]): Promise>;
signPsbt(chainId: string, psbtHex: string, options?: SignPsbtOptions): Promise;
signPsbts(chainId: string, psbtsHexes: string[], options?: SignPsbtOptions): Promise;
protectedTryOpenSidePanelIfEnabled(ignoreGestureFailure?: boolean): Promise;
readonly ethereum: EthereumProvider;
readonly starknet: StarknetProvider;
readonly bitcoin: BitcoinProvider;
}
declare class EthereumProvider extends EventEmitter implements IEthereumProvider {
protected readonly keplr: Keplr;
protected readonly requester: MessageRequester;
chainId: string | null;
selectedAddress: string | null;
networkVersion: string | null;
isKeplr: boolean;
isMetaMask: boolean;
constructor(keplr: Keplr, requester: MessageRequester);
protected protectedEnableAccess(newCurrentChainId?: string): Promise;
protected protectedGetNewCurrentChainIdFromRequest(method: string, params?: readonly unknown[] | Record): Promise;
protected protectedCheckNeedEnableAccess(method: string): Promise;
isConnected(): boolean;
request({ method, params, providerId, chainId, }: {
method: string;
params?: readonly unknown[] | Record;
providerId?: string;
chainId?: string;
}): Promise;
/**
* Legacy methods
*/
enable(): Promise;
net_version(): Promise;
}
declare class StarknetProvider implements IStarknetProvider {
protected readonly keplr: Keplr;
protected readonly requester: MessageRequester;
id: string;
name: string;
version: string;
icon: string;
isConnected: boolean;
chainId?: string | undefined;
selectedAddress?: string | undefined;
account?: AccountInterface;
provider?: ProviderInterface;
constructor(keplr: Keplr, requester: MessageRequester);
protected protectedEnableAccess(newCurrentChainId?: string): Promise;
protected protectedGetNewCurrentChainIdFromRequest(method: string, params?: readonly unknown[] | Record): Promise;
protected protectedCheckNeedEnableAccess(method: string, params?: readonly unknown[] | Record): Promise;
request({ type, params, }: {
type: string;
params?: unknown[] | Record;
}): Promise;
enable(_options?: {
starknetVersion?: "v4" | "v5";
}): Promise;
isPreauthorized(): Promise;
on(_event: E["type"], _handleEvent: E["handler"]): void;
off(_event: E["type"], _handleEvent: E["handler"]): void;
}
declare class BitcoinProvider extends EventEmitter implements IBitcoinProvider {
protected readonly keplr: Keplr;
protected readonly requester: MessageRequester;
constructor(keplr: Keplr, requester: MessageRequester);
protected protectedEnableAccess(): Promise;
getAccounts(): Promise;
requestAccounts(): Promise;
disconnect(): Promise;
getNetwork(): Promise;
switchNetwork(network: BitcoinNetwork): Promise;
getChain(): Promise<{
enum: BitcoinChainType;
name: string;
network: BitcoinNetwork;
}>;
switchChain(chain: BitcoinChainType): Promise;
getPublicKey(): Promise;
getBalance(): Promise<{
confirmed: number;
unconfirmed: number;
total: number;
}>;
getInscriptions(offset?: number, limit?: number): Promise<{
total: number;
list: Inscription[];
}>;
signMessage(message: string, signType?: BitcoinSignMessageType): Promise;
sendBitcoin(to: string, amount: number): Promise;
pushTx(rawTxHex: string): Promise;
pushPsbt(psbtHex: string): Promise;
signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise;
signPsbts(psbtsHexes: string[], options?: SignPsbtOptions): Promise;
getAddress(): Promise;
connectWallet(): Promise;
}
export {};