-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.mts
More file actions
51 lines (48 loc) · 1.82 KB
/
index.d.mts
File metadata and controls
51 lines (48 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react';
import { WalletSelector, AccountState, VerifyOwnerParams, VerifiedOwner, WalletModuleFactory } from '@near-wallet-selector/core';
export { Account, BrowserWallet, Wallet, WalletBehaviourFactory, WalletModule, WalletModuleFactory } from '@near-wallet-selector/core';
import { WalletSelectorModal } from '@near-wallet-selector/modal-ui';
interface ContextProviderType {
children: React.ReactNode;
network?: 'testnet' | 'mainnet';
onlyMbWallet?: boolean;
contractAddress?: string;
additionalWallets?: Array<WalletModuleFactory>;
onlyBitteWallet?: boolean;
walletUrl?: string;
}
type BitteWalletContext = {
selector: WalletSelector;
modal: WalletSelectorModal | undefined;
accounts: AccountState[];
activeAccountId: string | null;
isConnected: boolean;
isWaitingForConnection: boolean;
isWalletSelectorSetup: boolean;
errorMessage: string | null;
connect: () => Promise<void>;
disconnect: () => Promise<void>;
signMessage: (params: VerifyOwnerParams) => Promise<VerifiedOwner>;
};
declare const BitteWalletContext: React.Context<BitteWalletContext | null>;
declare const BitteWalletContextProvider: React.FC<ContextProviderType>;
declare const useBitteWallet: () => BitteWalletContext;
type UseNearPriceReturn = {
nearPrice: number;
error: string | null;
};
declare const useNearPrice: () => UseNearPriceReturn;
interface ParsedDataReturn<T> {
error?: null | string;
data?: T | null;
}
interface NearPriceData {
price?: string;
}
interface CoinGeckoNearPriceData {
near?: {
usd: string;
};
}
declare const nearPrice: () => Promise<ParsedDataReturn<string>>;
export { BitteWalletContext, BitteWalletContextProvider, type CoinGeckoNearPriceData, type NearPriceData, type ParsedDataReturn, nearPrice, useBitteWallet, useNearPrice };