@unisat/wallet-state 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.mts +934 -0
- package/lib/index.d.ts +934 -0
- package/lib/index.js +2225 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +2124 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +19 -5
- package/src/actions/global.ts +5 -0
- package/src/context/I18nContext.tsx +191 -0
- package/src/context/PriceContext.tsx +81 -0
- package/src/context/WalletContext.tsx +703 -0
- package/src/context/index.ts +3 -0
- package/src/hooks/accounts.ts +23 -21
- package/src/hooks/approval.ts +72 -0
- package/src/hooks/base.ts +6 -0
- package/src/hooks/discovery.ts +29 -0
- package/src/hooks/global.ts +129 -5
- package/src/hooks/i18n.ts +53 -0
- package/src/hooks/index.ts +9 -15
- package/src/hooks/keyrings.ts +14 -5
- package/src/hooks/settings.ts +318 -5
- package/src/hooks/transactions.ts +44 -38
- package/src/hooks/ui.ts +133 -5
- package/src/index.ts +42 -5
- package/src/{slices → reducers}/accounts.ts +12 -12
- package/src/reducers/discovery.ts +73 -0
- package/src/reducers/global.ts +51 -0
- package/src/{slices → reducers}/keyrings.ts +7 -6
- package/src/{slices → reducers}/settings.ts +5 -5
- package/src/{slices → reducers}/transactions.ts +4 -5
- package/src/{slices → reducers}/ui.ts +4 -5
- package/src/updater/accounts.ts +107 -0
- package/src/updater/index.ts +1 -0
- package/src/utils/bitcoin-utils.ts +81 -0
- package/src/utils/eventBus.ts +49 -0
- package/src/utils/i18n.ts +41 -0
- package/src/slices/global.ts +0 -52
- package/src/slices/index.ts +0 -10
- package/src/store/index.ts +0 -43
- package/src/types/index.ts +0 -37
package/lib/index.d.mts
ADDED
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
import * as _reduxjs_toolkit_dist_configureStore from '@reduxjs/toolkit/dist/configureStore';
|
|
2
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
3
|
+
import * as _unisat_wallet_types from '@unisat/wallet-types';
|
|
4
|
+
import { ChainType, NetworkType, AddressType } from '@unisat/wallet-types';
|
|
5
|
+
import * as _unisat_wallet_shared from '@unisat/wallet-shared';
|
|
6
|
+
import { AppInfo, Inscription, WalletKeyring, WalletConfig, UnspentOutput, Account, BitcoinBalanceV2, TxHistoryItem, AppSummary, InscriptionSummary, AddressSummary, BitcoinBalance, ToSignInput, ConnectedSite, FeeSummary, CoinPrice, TickPriceItem, InscribeOrder, TokenTransfer, DecodedPsbt, TokenBalance, AddressTokenSummary, UTXO_Detail, UTXO, WebsiteResult, SignPsbtOptions, AddressFlagType, VersionDetail, CosmosSignDataType, RuneBalance, AddressRunesTokenSummary, CAT20Balance, AddressCAT20TokenSummary, AddressCAT20UtxoSummary, UserToSignInput, CAT20MergeOrder, CAT721Balance, AddressCAT721CollectionSummary, BtcChannelItem, BabylonAddressSummary, CosmosBalance, AlkanesBalance, AddressAlkanesTokenSummary, AlkanesCollection, AlkanesInfo, BRC20HistoryItem, CAT_VERSION, ToAddressInfo, RawTxInfo, TypeChain } from '@unisat/wallet-shared';
|
|
7
|
+
import React, { ReactNode } from 'react';
|
|
8
|
+
import * as _unisat_babylon_service_types from '@unisat/babylon-service/types';
|
|
9
|
+
import { BabylonConfigV2 } from '@unisat/babylon-service/types';
|
|
10
|
+
import { TypedUseSelectorHook } from 'react-redux';
|
|
11
|
+
|
|
12
|
+
interface DiscoveryState {
|
|
13
|
+
bannerList: {
|
|
14
|
+
id: string;
|
|
15
|
+
img: string;
|
|
16
|
+
link: string;
|
|
17
|
+
}[];
|
|
18
|
+
appList: {
|
|
19
|
+
tab: string;
|
|
20
|
+
items: AppInfo[];
|
|
21
|
+
}[];
|
|
22
|
+
lastFetchTime: number;
|
|
23
|
+
lastFetchChainType: ChainType;
|
|
24
|
+
cachedBannerIds: string[];
|
|
25
|
+
hasNewBanner: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface UIState {
|
|
29
|
+
assetTabKey: AssetTabKey;
|
|
30
|
+
ordinalsAssetTabKey: OrdinalsAssetTabKey;
|
|
31
|
+
catAssetTabKey: CATAssetTabKey;
|
|
32
|
+
alkanesAssetTabKey: AlkanesAssetTabKey;
|
|
33
|
+
uiTxCreateScreen: {
|
|
34
|
+
toInfo: {
|
|
35
|
+
address: string;
|
|
36
|
+
domain: string;
|
|
37
|
+
inscription?: Inscription;
|
|
38
|
+
};
|
|
39
|
+
inputAmount: string;
|
|
40
|
+
enableRBF: boolean;
|
|
41
|
+
feeRate: number;
|
|
42
|
+
};
|
|
43
|
+
babylonSendScreen: {
|
|
44
|
+
inputAmount: string;
|
|
45
|
+
memo: string;
|
|
46
|
+
};
|
|
47
|
+
navigationSource: NavigationSource;
|
|
48
|
+
isBalanceHidden: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare enum AssetTabKey {
|
|
51
|
+
ORDINALS = 0,
|
|
52
|
+
ATOMICALS = 1,
|
|
53
|
+
RUNES = 2,
|
|
54
|
+
CAT = 3,
|
|
55
|
+
ALKANES = 4
|
|
56
|
+
}
|
|
57
|
+
declare enum OrdinalsAssetTabKey {
|
|
58
|
+
ALL = 0,
|
|
59
|
+
BRC20 = 1,
|
|
60
|
+
BRC20_6BYTE = 2
|
|
61
|
+
}
|
|
62
|
+
declare enum CATAssetTabKey {
|
|
63
|
+
CAT20 = 0,
|
|
64
|
+
CAT721 = 1,
|
|
65
|
+
CAT20_V2 = 2,
|
|
66
|
+
CAT721_V2 = 3
|
|
67
|
+
}
|
|
68
|
+
declare enum AlkanesAssetTabKey {
|
|
69
|
+
TOKEN = 0,
|
|
70
|
+
COLLECTION = 1
|
|
71
|
+
}
|
|
72
|
+
declare enum NavigationSource {
|
|
73
|
+
BACK = 0,
|
|
74
|
+
NORMAL = 1
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface KeyringsState {
|
|
78
|
+
keyrings: WalletKeyring[];
|
|
79
|
+
current: WalletKeyring;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
type TabOption = 'home' | 'discover' | 'settings';
|
|
83
|
+
interface GlobalState {
|
|
84
|
+
tab: TabOption;
|
|
85
|
+
isUnlocked: boolean;
|
|
86
|
+
isReady: boolean;
|
|
87
|
+
isBooted: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface SettingsState {
|
|
91
|
+
locale: string;
|
|
92
|
+
networkType: NetworkType;
|
|
93
|
+
chainType: ChainType;
|
|
94
|
+
walletConfig: WalletConfig;
|
|
95
|
+
skippedVersion: string;
|
|
96
|
+
autoLockTimeId: number;
|
|
97
|
+
developerMode: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface BitcoinTx {
|
|
101
|
+
fromAddress: string;
|
|
102
|
+
toAddress: string;
|
|
103
|
+
toSatoshis: number;
|
|
104
|
+
rawtx: string;
|
|
105
|
+
txid: string;
|
|
106
|
+
fee: number;
|
|
107
|
+
estimateFee: number;
|
|
108
|
+
changeSatoshis: number;
|
|
109
|
+
sending: boolean;
|
|
110
|
+
autoAdjust: boolean;
|
|
111
|
+
psbtHex: string;
|
|
112
|
+
feeRate: number;
|
|
113
|
+
toDomain: string;
|
|
114
|
+
enableRBF: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface OrdinalsTx {
|
|
117
|
+
fromAddress: string;
|
|
118
|
+
toAddress: string;
|
|
119
|
+
inscription: Inscription;
|
|
120
|
+
rawtx: string;
|
|
121
|
+
txid: string;
|
|
122
|
+
fee: number;
|
|
123
|
+
estimateFee: number;
|
|
124
|
+
changeSatoshis: number;
|
|
125
|
+
sending: boolean;
|
|
126
|
+
psbtHex: string;
|
|
127
|
+
feeRate: number;
|
|
128
|
+
toDomain: string;
|
|
129
|
+
outputValue: number;
|
|
130
|
+
enableRBF: boolean;
|
|
131
|
+
}
|
|
132
|
+
interface RunesTx {
|
|
133
|
+
fromAddress: string;
|
|
134
|
+
toAddress: string;
|
|
135
|
+
rawtx: string;
|
|
136
|
+
txid: string;
|
|
137
|
+
fee: number;
|
|
138
|
+
estimateFee: number;
|
|
139
|
+
changeSatoshis: number;
|
|
140
|
+
sending: boolean;
|
|
141
|
+
psbtHex: string;
|
|
142
|
+
feeRate: number;
|
|
143
|
+
toDomain: string;
|
|
144
|
+
outputValue: number;
|
|
145
|
+
enableRBF: boolean;
|
|
146
|
+
runeid?: string;
|
|
147
|
+
runeAmount?: string;
|
|
148
|
+
}
|
|
149
|
+
interface TransactionsState {
|
|
150
|
+
bitcoinTx: BitcoinTx;
|
|
151
|
+
ordinalsTx: OrdinalsTx;
|
|
152
|
+
runesTx: RunesTx;
|
|
153
|
+
utxos: UnspentOutput[];
|
|
154
|
+
spendUnavailableUtxos: UnspentOutput[];
|
|
155
|
+
assetUtxos_inscriptions: UnspentOutput[];
|
|
156
|
+
assetUtxos_runes: UnspentOutput[];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
interface AccountsState {
|
|
160
|
+
accounts: Account[];
|
|
161
|
+
current: Account;
|
|
162
|
+
loading: boolean;
|
|
163
|
+
balanceMap: {
|
|
164
|
+
[key: string]: {
|
|
165
|
+
amount: string;
|
|
166
|
+
btc_amount: string;
|
|
167
|
+
confirm_btc_amount: string;
|
|
168
|
+
pending_btc_amount: string;
|
|
169
|
+
inscription_amount: string;
|
|
170
|
+
expired: boolean;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
balanceV2Map: {
|
|
174
|
+
[key: string]: BitcoinBalanceV2;
|
|
175
|
+
};
|
|
176
|
+
historyMap: {
|
|
177
|
+
[key: string]: {
|
|
178
|
+
list: TxHistoryItem[];
|
|
179
|
+
expired: boolean;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
inscriptionsMap: {
|
|
183
|
+
[key: string]: {
|
|
184
|
+
list: Inscription[];
|
|
185
|
+
expired: boolean;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
appSummary: AppSummary;
|
|
189
|
+
inscriptionSummary: InscriptionSummary;
|
|
190
|
+
addressSummary: AddressSummary;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare const I18nProvider: React.FC<{
|
|
194
|
+
children: React.ReactNode;
|
|
195
|
+
}>;
|
|
196
|
+
|
|
197
|
+
interface ContactBookItem {
|
|
198
|
+
name: string;
|
|
199
|
+
address: string;
|
|
200
|
+
chain: ChainType;
|
|
201
|
+
isAlias: boolean;
|
|
202
|
+
isContact: boolean;
|
|
203
|
+
sortIndex?: number;
|
|
204
|
+
}
|
|
205
|
+
type ContactBookStore = Record<string, ContactBookItem | undefined>;
|
|
206
|
+
interface WalletController {
|
|
207
|
+
openapi: {
|
|
208
|
+
[key: string]: (...params: any) => Promise<any>;
|
|
209
|
+
};
|
|
210
|
+
boot(password: string): Promise<void>;
|
|
211
|
+
isBooted(): Promise<boolean>;
|
|
212
|
+
getApproval(): Promise<any>;
|
|
213
|
+
resolveApproval(data?: any, data2?: any): Promise<void>;
|
|
214
|
+
rejectApproval(data?: any, data2?: any, data3?: any): Promise<void>;
|
|
215
|
+
hasVault(): Promise<boolean>;
|
|
216
|
+
verifyPassword(password: string): Promise<void>;
|
|
217
|
+
changePassword: (password: string, newPassword: string) => Promise<void>;
|
|
218
|
+
unlock(password: string): Promise<void>;
|
|
219
|
+
isUnlocked(): Promise<boolean>;
|
|
220
|
+
lockWallet(): Promise<void>;
|
|
221
|
+
setPopupOpen(isOpen: boolean): void;
|
|
222
|
+
isReady(): Promise<boolean>;
|
|
223
|
+
getIsFirstOpen(): Promise<boolean>;
|
|
224
|
+
updateIsFirstOpen(): Promise<void>;
|
|
225
|
+
getAddressBalanceV2(address: string): Promise<BitcoinBalanceV2>;
|
|
226
|
+
getAddressBalance(address: string): Promise<BitcoinBalance>;
|
|
227
|
+
getAddressCacheBalance(address: string): Promise<BitcoinBalance>;
|
|
228
|
+
getMultiAddressAssets(addresses: string): Promise<AddressSummary[]>;
|
|
229
|
+
findGroupAssets(groups: {
|
|
230
|
+
type: number;
|
|
231
|
+
address_arr: string[];
|
|
232
|
+
pubkey_arr: string[];
|
|
233
|
+
}[]): Promise<{
|
|
234
|
+
type: number;
|
|
235
|
+
address_arr: string[];
|
|
236
|
+
pubkey_arr: string[];
|
|
237
|
+
satoshis_arr: number[];
|
|
238
|
+
}[]>;
|
|
239
|
+
getAddressInscriptions(address: string, cursor: number, size: number): Promise<{
|
|
240
|
+
list: Inscription[];
|
|
241
|
+
total: number;
|
|
242
|
+
}>;
|
|
243
|
+
getAddressHistory: (params: {
|
|
244
|
+
address: string;
|
|
245
|
+
start: number;
|
|
246
|
+
limit: number;
|
|
247
|
+
}) => Promise<{
|
|
248
|
+
start: number;
|
|
249
|
+
total: number;
|
|
250
|
+
detail: TxHistoryItem[];
|
|
251
|
+
}>;
|
|
252
|
+
getAddressCacheHistory: (address: string) => Promise<TxHistoryItem[]>;
|
|
253
|
+
getLocale(): Promise<string>;
|
|
254
|
+
setLocale(locale: string): Promise<void>;
|
|
255
|
+
getCurrency(): Promise<string>;
|
|
256
|
+
setCurrency(currency: string): Promise<void>;
|
|
257
|
+
clearKeyrings(): Promise<void>;
|
|
258
|
+
getPrivateKey(password: string, account: {
|
|
259
|
+
address: string;
|
|
260
|
+
type: string;
|
|
261
|
+
}): Promise<{
|
|
262
|
+
hex: string;
|
|
263
|
+
wif: string;
|
|
264
|
+
}>;
|
|
265
|
+
getMnemonics(password: string, keyring: WalletKeyring): Promise<{
|
|
266
|
+
hdPath: string;
|
|
267
|
+
mnemonic: string;
|
|
268
|
+
passphrase: string;
|
|
269
|
+
}>;
|
|
270
|
+
createKeyringWithPrivateKey(data: string, addressType: AddressType, alianName?: string): Promise<Account[]>;
|
|
271
|
+
getPreMnemonics(): Promise<any>;
|
|
272
|
+
generatePreMnemonic(): Promise<string>;
|
|
273
|
+
removePreMnemonics(): void;
|
|
274
|
+
createKeyringWithMnemonics(mnemonic: string, hdPath: string, passphrase: string, addressType: AddressType, accountCount: number): Promise<{
|
|
275
|
+
address: string;
|
|
276
|
+
type: string;
|
|
277
|
+
}[]>;
|
|
278
|
+
createKeyringWithKeystone(urType: string, urCbor: string, addressType: AddressType, hdPath: string, accountCount: number, filterPubkey?: string[], connectionType?: 'USB' | 'QR'): Promise<{
|
|
279
|
+
address: string;
|
|
280
|
+
type: string;
|
|
281
|
+
}[]>;
|
|
282
|
+
createTmpKeyringWithPrivateKey(privateKey: string, addressType: AddressType): Promise<WalletKeyring>;
|
|
283
|
+
createTmpKeyringWithKeystone(urType: string, urCbor: string, addressType: AddressType, hdPath: string, accountCount?: number): Promise<WalletKeyring>;
|
|
284
|
+
createKeyringWithColdWallet(xpub: string, addressType: AddressType, alianName?: string, hdPath?: string, accountCount?: number): Promise<WalletKeyring>;
|
|
285
|
+
deriveAccountsFromXpub(xpub: string, addressType: AddressType, hdPath?: string, accountCount?: number): Promise<{
|
|
286
|
+
pubkey: string;
|
|
287
|
+
address: string;
|
|
288
|
+
}[]>;
|
|
289
|
+
createTmpKeyringWithMnemonics(mnemonic: string, hdPath: string, passphrase: string, addressType: AddressType, accountCount?: number): Promise<WalletKeyring>;
|
|
290
|
+
removeKeyring(keyring: WalletKeyring): Promise<WalletKeyring>;
|
|
291
|
+
deriveNewAccountFromMnemonic(keyring: WalletKeyring, alianName?: string): Promise<string[]>;
|
|
292
|
+
getAccountsCount(): Promise<number>;
|
|
293
|
+
getAllAlianName: () => (ContactBookItem | undefined)[];
|
|
294
|
+
getContactsByMap: () => ContactBookStore;
|
|
295
|
+
getCurrentAccount(): Promise<Account>;
|
|
296
|
+
getAccounts(): Promise<Account[]>;
|
|
297
|
+
getNextAlianName: (keyring: WalletKeyring) => Promise<string>;
|
|
298
|
+
getCurrentKeyringAccounts(): Promise<Account[]>;
|
|
299
|
+
signPsbtWithHex(psbtHex: string, toSignInputs: ToSignInput[], autoFinalized: boolean): Promise<string>;
|
|
300
|
+
sendBTC(data: {
|
|
301
|
+
to: string;
|
|
302
|
+
amount: number;
|
|
303
|
+
btcUtxos: UnspentOutput[];
|
|
304
|
+
feeRate: number;
|
|
305
|
+
enableRBF: boolean;
|
|
306
|
+
memo?: string;
|
|
307
|
+
memos?: string[];
|
|
308
|
+
}): Promise<{
|
|
309
|
+
psbtHex: string;
|
|
310
|
+
rawtx: string;
|
|
311
|
+
fee: number;
|
|
312
|
+
}>;
|
|
313
|
+
sendAllBTC(data: {
|
|
314
|
+
to: string;
|
|
315
|
+
btcUtxos: UnspentOutput[];
|
|
316
|
+
feeRate: number;
|
|
317
|
+
enableRBF: boolean;
|
|
318
|
+
}): Promise<{
|
|
319
|
+
psbtHex: string;
|
|
320
|
+
rawtx: string;
|
|
321
|
+
fee: number;
|
|
322
|
+
}>;
|
|
323
|
+
sendOrdinalsInscription(data: {
|
|
324
|
+
to: string;
|
|
325
|
+
inscriptionId: string;
|
|
326
|
+
feeRate: number;
|
|
327
|
+
outputValue?: number;
|
|
328
|
+
enableRBF: boolean;
|
|
329
|
+
btcUtxos: UnspentOutput[];
|
|
330
|
+
}): Promise<{
|
|
331
|
+
psbtHex: string;
|
|
332
|
+
rawtx: string;
|
|
333
|
+
fee: number;
|
|
334
|
+
}>;
|
|
335
|
+
sendOrdinalsInscriptions(data: {
|
|
336
|
+
to: string;
|
|
337
|
+
inscriptionIds: string[];
|
|
338
|
+
feeRate: number;
|
|
339
|
+
enableRBF: boolean;
|
|
340
|
+
btcUtxos: UnspentOutput[];
|
|
341
|
+
}): Promise<{
|
|
342
|
+
psbtHex: string;
|
|
343
|
+
rawtx: string;
|
|
344
|
+
fee: number;
|
|
345
|
+
}>;
|
|
346
|
+
splitOrdinalsInscription(data: {
|
|
347
|
+
inscriptionId: string;
|
|
348
|
+
feeRate: number;
|
|
349
|
+
outputValue: number;
|
|
350
|
+
enableRBF: boolean;
|
|
351
|
+
btcUtxos: UnspentOutput[];
|
|
352
|
+
}): Promise<{
|
|
353
|
+
psbtHex: string;
|
|
354
|
+
rawtx: string;
|
|
355
|
+
fee: number;
|
|
356
|
+
splitedCount: number;
|
|
357
|
+
}>;
|
|
358
|
+
pushTx(rawtx: string): Promise<string>;
|
|
359
|
+
queryDomainInfo(domain: string): Promise<Inscription>;
|
|
360
|
+
getInscriptionSummary(): Promise<InscriptionSummary>;
|
|
361
|
+
getAppSummary(): Promise<AppSummary>;
|
|
362
|
+
getBTCUtxos(): Promise<UnspentOutput[]>;
|
|
363
|
+
getAssetUtxosInscriptions(inscriptionId: string): Promise<UnspentOutput[]>;
|
|
364
|
+
getNetworkType(): Promise<NetworkType>;
|
|
365
|
+
setNetworkType(type: NetworkType): Promise<void>;
|
|
366
|
+
getChainType(): Promise<ChainType>;
|
|
367
|
+
setChainType(type: ChainType): Promise<void>;
|
|
368
|
+
getConnectedSites(): Promise<ConnectedSite[]>;
|
|
369
|
+
removeConnectedSite(origin: string): Promise<void>;
|
|
370
|
+
getCurrentConnectedSite(id: string): Promise<ConnectedSite>;
|
|
371
|
+
getCurrentKeyring(): Promise<WalletKeyring>;
|
|
372
|
+
getKeyrings(): Promise<WalletKeyring[]>;
|
|
373
|
+
changeKeyring(keyring: WalletKeyring, accountIndex?: number): Promise<void>;
|
|
374
|
+
getAllAddresses(keyring: WalletKeyring, index: number): Promise<string[]>;
|
|
375
|
+
setKeyringAlianName(keyring: WalletKeyring, name: string): Promise<WalletKeyring>;
|
|
376
|
+
changeAddressType(addressType: AddressType): Promise<void>;
|
|
377
|
+
setAccountAlianName(account: Account, name: string): Promise<Account>;
|
|
378
|
+
getFeeSummary(): Promise<FeeSummary>;
|
|
379
|
+
getCoinPrice(): Promise<CoinPrice>;
|
|
380
|
+
getBrc20sPrice(ticks: string[]): Promise<{
|
|
381
|
+
[tick: string]: TickPriceItem;
|
|
382
|
+
}>;
|
|
383
|
+
getRunesPrice(ticks: string[]): Promise<{
|
|
384
|
+
[tick: string]: TickPriceItem;
|
|
385
|
+
}>;
|
|
386
|
+
getCAT20sPrice(tokenIds: string[]): Promise<{
|
|
387
|
+
[tokenId: string]: TickPriceItem;
|
|
388
|
+
}>;
|
|
389
|
+
getAlkanesPrice(alkaneid: string[]): Promise<{
|
|
390
|
+
[tick: string]: TickPriceItem;
|
|
391
|
+
}>;
|
|
392
|
+
setEditingKeyring(keyringIndex: number): Promise<void>;
|
|
393
|
+
getEditingKeyring(): Promise<WalletKeyring>;
|
|
394
|
+
setEditingAccount(account: Account): Promise<void>;
|
|
395
|
+
getEditingAccount(): Promise<Account>;
|
|
396
|
+
inscribeBRC20Transfer(address: string, tick: string, amount: string, feeRate: number, outputValue: number): Promise<InscribeOrder>;
|
|
397
|
+
getInscribeResult(orderId: string): Promise<TokenTransfer>;
|
|
398
|
+
decodePsbt(psbtHex: string, website: string): Promise<DecodedPsbt>;
|
|
399
|
+
decodeContracts(contracts: any[], account: any): Promise<any[]>;
|
|
400
|
+
getAllInscriptionList(address: string, currentPage: number, pageSize: number): Promise<{
|
|
401
|
+
currentPage: number;
|
|
402
|
+
pageSize: number;
|
|
403
|
+
total: number;
|
|
404
|
+
list: Inscription[];
|
|
405
|
+
}>;
|
|
406
|
+
getBRC20List(address: string, currentPage: number, pageSize: number): Promise<{
|
|
407
|
+
currentPage: number;
|
|
408
|
+
pageSize: number;
|
|
409
|
+
total: number;
|
|
410
|
+
list: TokenBalance[];
|
|
411
|
+
}>;
|
|
412
|
+
getBRC20ProgList(address: string, currentPage: number, pageSize: number): Promise<{
|
|
413
|
+
currentPage: number;
|
|
414
|
+
pageSize: number;
|
|
415
|
+
total: number;
|
|
416
|
+
list: TokenBalance[];
|
|
417
|
+
}>;
|
|
418
|
+
getBRC20TransferableList(address: string, ticker: string, currentPage: number, pageSize: number): Promise<{
|
|
419
|
+
currentPage: number;
|
|
420
|
+
pageSize: number;
|
|
421
|
+
total: number;
|
|
422
|
+
list: TokenTransfer[];
|
|
423
|
+
}>;
|
|
424
|
+
getOrdinalsInscriptions(address: string, currentPage: number, pageSize: number): Promise<{
|
|
425
|
+
currentPage: number;
|
|
426
|
+
pageSize: number;
|
|
427
|
+
total: number;
|
|
428
|
+
list: Inscription[];
|
|
429
|
+
}>;
|
|
430
|
+
getBRC20Summary(address: string, ticker: string): Promise<AddressTokenSummary>;
|
|
431
|
+
expireUICachedData(address: string): Promise<void>;
|
|
432
|
+
getWalletConfig(): Promise<WalletConfig>;
|
|
433
|
+
getSkippedVersion(): Promise<string>;
|
|
434
|
+
setSkippedVersion(version: string): Promise<void>;
|
|
435
|
+
getInscriptionUtxoDetail(inscriptionId: string): Promise<UTXO_Detail>;
|
|
436
|
+
getUtxoByInscriptionId(inscriptionId: string): Promise<UTXO>;
|
|
437
|
+
getInscriptionInfo(inscriptionId: string): Promise<Inscription>;
|
|
438
|
+
checkWebsite(website: string): Promise<WebsiteResult>;
|
|
439
|
+
readTab(tabName: string): Promise<void>;
|
|
440
|
+
readApp(appid: number): Promise<void>;
|
|
441
|
+
formatOptionsToSignInputs(psbtHex: string, options?: SignPsbtOptions): Promise<ToSignInput[]>;
|
|
442
|
+
getAddressSummary(address: string): Promise<AddressSummary>;
|
|
443
|
+
getShowSafeNotice(): Promise<boolean>;
|
|
444
|
+
setShowSafeNotice(show: boolean): Promise<void>;
|
|
445
|
+
addAddressFlag(account: Account, flag: AddressFlagType): Promise<Account>;
|
|
446
|
+
removeAddressFlag(account: Account, flag: AddressFlagType): Promise<Account>;
|
|
447
|
+
getVersionDetail(version: string): Promise<VersionDetail>;
|
|
448
|
+
genSignPsbtUr(psbtHex: string): Promise<{
|
|
449
|
+
type: string;
|
|
450
|
+
cbor: string;
|
|
451
|
+
}>;
|
|
452
|
+
parseSignPsbtUr(type: string, cbor: string, isFinalize?: boolean): Promise<{
|
|
453
|
+
psbtHex: string;
|
|
454
|
+
rawtx?: string;
|
|
455
|
+
}>;
|
|
456
|
+
genSignMsgUr(text: string, msgType?: string): Promise<{
|
|
457
|
+
type: string;
|
|
458
|
+
cbor: string;
|
|
459
|
+
requestId: string;
|
|
460
|
+
}>;
|
|
461
|
+
parseSignMsgUr(type: string, cbor: string, msgType: string): Promise<{
|
|
462
|
+
signature: string;
|
|
463
|
+
}>;
|
|
464
|
+
getKeystoneConnectionType(): Promise<'USB' | 'QR'>;
|
|
465
|
+
genSignCosmosUr(cosmosSignRequest: {
|
|
466
|
+
requestId?: string;
|
|
467
|
+
signData: string;
|
|
468
|
+
dataType: CosmosSignDataType;
|
|
469
|
+
path: string;
|
|
470
|
+
chainId?: string;
|
|
471
|
+
accountNumber?: string;
|
|
472
|
+
address?: string;
|
|
473
|
+
}): Promise<{
|
|
474
|
+
type: string;
|
|
475
|
+
cbor: string;
|
|
476
|
+
requestId: string;
|
|
477
|
+
}>;
|
|
478
|
+
parseCosmosSignUr(type: string, cbor: string): Promise<any>;
|
|
479
|
+
cosmosSignData(chainId: string, signBytesHex: string): Promise<{
|
|
480
|
+
publicKey: string;
|
|
481
|
+
signature: string;
|
|
482
|
+
}>;
|
|
483
|
+
getEnableSignData(): Promise<boolean>;
|
|
484
|
+
setEnableSignData(enable: boolean): Promise<void>;
|
|
485
|
+
getRunesList(address: string, currentPage: number, pageSize: number): Promise<{
|
|
486
|
+
currentPage: number;
|
|
487
|
+
pageSize: number;
|
|
488
|
+
total: number;
|
|
489
|
+
list: RuneBalance[];
|
|
490
|
+
}>;
|
|
491
|
+
getAssetUtxosRunes(rune: string): Promise<UnspentOutput[]>;
|
|
492
|
+
getAddressRunesTokenSummary(address: string, runeid: string): Promise<AddressRunesTokenSummary>;
|
|
493
|
+
sendRunes(data: {
|
|
494
|
+
to: string;
|
|
495
|
+
runeid: string;
|
|
496
|
+
runeAmount: string;
|
|
497
|
+
feeRate: number;
|
|
498
|
+
enableRBF: boolean;
|
|
499
|
+
btcUtxos?: UnspentOutput[];
|
|
500
|
+
assetUtxos?: UnspentOutput[];
|
|
501
|
+
outputValue?: number;
|
|
502
|
+
}): Promise<{
|
|
503
|
+
psbtHex: string;
|
|
504
|
+
rawtx: string;
|
|
505
|
+
fee: number;
|
|
506
|
+
}>;
|
|
507
|
+
setAutoLockTimeId(timeId: number): Promise<void>;
|
|
508
|
+
getAutoLockTimeId(): Promise<number>;
|
|
509
|
+
getDeveloperMode(): Promise<boolean>;
|
|
510
|
+
setDeveloperMode(developerMode: boolean): Promise<void>;
|
|
511
|
+
getCAT20List(version: 'v1' | 'v2', address: string, currentPage: number, pageSize: number): Promise<{
|
|
512
|
+
currentPage: number;
|
|
513
|
+
pageSize: number;
|
|
514
|
+
total: number;
|
|
515
|
+
list: CAT20Balance[];
|
|
516
|
+
}>;
|
|
517
|
+
getAddressCAT20TokenSummary(version: 'v1' | 'v2', address: string, tokenId: string): Promise<AddressCAT20TokenSummary>;
|
|
518
|
+
getAddressCAT20UtxoSummary(version: 'v1' | 'v2', address: string, tokenId: string): Promise<AddressCAT20UtxoSummary>;
|
|
519
|
+
transferCAT20Step1(version: 'v1' | 'v2', to: string, tokenId: string, tokenAmount: string, feeRate: number): Promise<{
|
|
520
|
+
id: string;
|
|
521
|
+
commitTx: string;
|
|
522
|
+
toSignInputs: UserToSignInput[];
|
|
523
|
+
feeRate: number;
|
|
524
|
+
}>;
|
|
525
|
+
transferCAT20Step2(version: 'v1' | 'v2', transferId: string, commitTx: string, toSignInputs: UserToSignInput[]): Promise<{
|
|
526
|
+
revealTx: string;
|
|
527
|
+
toSignInputs: UserToSignInput[];
|
|
528
|
+
}>;
|
|
529
|
+
transferCAT20Step3(version: 'v1' | 'v2', transferId: string, revealTx: string, toSignInputs: UserToSignInput[]): Promise<{
|
|
530
|
+
txid: string;
|
|
531
|
+
}>;
|
|
532
|
+
mergeCAT20Prepare(version: 'v1' | 'v2', tokenId: string, utxoCount: number, feeRate: number): Promise<CAT20MergeOrder>;
|
|
533
|
+
transferCAT20Step1ByMerge(version: 'v1' | 'v2', mergeId: string): Promise<{
|
|
534
|
+
id: string;
|
|
535
|
+
commitTx: string;
|
|
536
|
+
toSignInputs: UserToSignInput[];
|
|
537
|
+
feeRate: number;
|
|
538
|
+
}>;
|
|
539
|
+
getMergeCAT20Status(version: 'v1' | 'v2', mergeId: string): Promise<any>;
|
|
540
|
+
getAppList(): Promise<{
|
|
541
|
+
tab: string;
|
|
542
|
+
items: AppInfo[];
|
|
543
|
+
}[]>;
|
|
544
|
+
getBannerList(): Promise<{
|
|
545
|
+
id: string;
|
|
546
|
+
img: string;
|
|
547
|
+
link: string;
|
|
548
|
+
}[]>;
|
|
549
|
+
getBlockActiveInfo(): Promise<{
|
|
550
|
+
allTransactions: number;
|
|
551
|
+
allAddrs: number;
|
|
552
|
+
}>;
|
|
553
|
+
getCAT721List(version: 'v1' | 'v2', address: string, currentPage: number, pageSize: number): Promise<{
|
|
554
|
+
currentPage: number;
|
|
555
|
+
pageSize: number;
|
|
556
|
+
total: number;
|
|
557
|
+
list: CAT721Balance[];
|
|
558
|
+
}>;
|
|
559
|
+
getAddressCAT721CollectionSummary(version: 'v1' | 'v2', address: string, collectionId: string): Promise<AddressCAT721CollectionSummary>;
|
|
560
|
+
transferCAT721Step1(version: 'v1' | 'v2', to: string, collectionId: string, localId: string, feeRate: number): Promise<{
|
|
561
|
+
id: string;
|
|
562
|
+
commitTx: string;
|
|
563
|
+
toSignInputs: UserToSignInput[];
|
|
564
|
+
feeRate: number;
|
|
565
|
+
}>;
|
|
566
|
+
transferCAT721Step2(version: 'v1' | 'v2', transferId: string, commitTx: string, toSignInputs: UserToSignInput[]): Promise<{
|
|
567
|
+
revealTx: string;
|
|
568
|
+
toSignInputs: UserToSignInput[];
|
|
569
|
+
}>;
|
|
570
|
+
transferCAT721Step3(version: 'v1' | 'v2', transferId: string, revealTx: string, toSignInputs: UserToSignInput[]): Promise<{
|
|
571
|
+
txid: string;
|
|
572
|
+
}>;
|
|
573
|
+
getBuyCoinChannelList(coin: string): Promise<BtcChannelItem[]>;
|
|
574
|
+
createBuyCoinPaymentUrl(coin: string, address: string, channel: string): Promise<string>;
|
|
575
|
+
getBabylonAddress(address: string): Promise<string>;
|
|
576
|
+
getBabylonAddressSummary(chainId: string, babylonConfig?: BabylonConfigV2): Promise<BabylonAddressSummary>;
|
|
577
|
+
createSendTokenStep1(chainId: string, tokenBalance: CosmosBalance, to: string, memo: string, { gasLimit, gasPrice, gasAdjustment, }: {
|
|
578
|
+
gasLimit: number;
|
|
579
|
+
gasPrice: string;
|
|
580
|
+
gasAdjustment?: number;
|
|
581
|
+
}): Promise<string>;
|
|
582
|
+
createSendTokenStep2(chainId: string, signature: string): Promise<string>;
|
|
583
|
+
simulateBabylonGas(chainId: string, recipient: string, amount: {
|
|
584
|
+
denom: string;
|
|
585
|
+
amount: string;
|
|
586
|
+
}, memo: string): Promise<number>;
|
|
587
|
+
getBabylonConfig(): Promise<BabylonConfigV2>;
|
|
588
|
+
getContactByAddress(address: string): Promise<ContactBookItem | undefined>;
|
|
589
|
+
getContactByAddressAndChain(address: string, chain: ChainType): Promise<ContactBookItem | undefined>;
|
|
590
|
+
updateContact(data: ContactBookItem): Promise<void>;
|
|
591
|
+
removeContact(address: string, chain?: ChainType): Promise<void>;
|
|
592
|
+
listContacts(): Promise<ContactBookItem[]>;
|
|
593
|
+
saveContactsOrder(contacts: ContactBookItem[]): Promise<void>;
|
|
594
|
+
singleStepTransferBRC20Step1(params: {
|
|
595
|
+
userAddress: string;
|
|
596
|
+
userPubkey: string;
|
|
597
|
+
receiver: string;
|
|
598
|
+
ticker: string;
|
|
599
|
+
amount: string;
|
|
600
|
+
feeRate: number;
|
|
601
|
+
}): Promise<{
|
|
602
|
+
orderId: string;
|
|
603
|
+
psbtHex: string;
|
|
604
|
+
toSignInputs: UserToSignInput[];
|
|
605
|
+
}>;
|
|
606
|
+
singleStepTransferBRC20Step2(params: {
|
|
607
|
+
orderId: string;
|
|
608
|
+
commitTx: string;
|
|
609
|
+
toSignInputs: UserToSignInput[];
|
|
610
|
+
}): Promise<{
|
|
611
|
+
psbtHex: string;
|
|
612
|
+
toSignInputs: UserToSignInput[];
|
|
613
|
+
}>;
|
|
614
|
+
singleStepTransferBRC20Step3(params: {
|
|
615
|
+
orderId: string;
|
|
616
|
+
revealTx: string;
|
|
617
|
+
toSignInputs: UserToSignInput[];
|
|
618
|
+
}): Promise<{
|
|
619
|
+
txid: string;
|
|
620
|
+
}>;
|
|
621
|
+
setLastActiveTime(): void;
|
|
622
|
+
getOpenInSidePanel(): Promise<boolean>;
|
|
623
|
+
setOpenInSidePanel(openInSidePanel: boolean): Promise<void>;
|
|
624
|
+
sendCoinBypassHeadOffsets(tos: {
|
|
625
|
+
address: string;
|
|
626
|
+
satoshis: number;
|
|
627
|
+
}[], feeRate: number): Promise<{
|
|
628
|
+
psbtHex: string;
|
|
629
|
+
rawtx: string;
|
|
630
|
+
fee: number;
|
|
631
|
+
}>;
|
|
632
|
+
getAlkanesList(address: string, currentPage: number, pageSize: number): Promise<{
|
|
633
|
+
currentPage: number;
|
|
634
|
+
pageSize: number;
|
|
635
|
+
total: number;
|
|
636
|
+
list: AlkanesBalance[];
|
|
637
|
+
}>;
|
|
638
|
+
getAssetUtxosAlkanes(rune: string): Promise<UnspentOutput[]>;
|
|
639
|
+
getAddressAlkanesTokenSummary(address: string, alkaneid: string, fetchAvailable: boolean): Promise<AddressAlkanesTokenSummary>;
|
|
640
|
+
createAlkanesSendTx(params: {
|
|
641
|
+
userAddress: string;
|
|
642
|
+
userPubkey: string;
|
|
643
|
+
receiver: string;
|
|
644
|
+
alkaneid: string;
|
|
645
|
+
amount: string;
|
|
646
|
+
feeRate: number;
|
|
647
|
+
}): Promise<{
|
|
648
|
+
psbtHex: string;
|
|
649
|
+
toSignInputs: UserToSignInput[];
|
|
650
|
+
}>;
|
|
651
|
+
signAlkanesSendTx(params: {
|
|
652
|
+
commitTx: string;
|
|
653
|
+
toSignInputs: ToSignInput[];
|
|
654
|
+
}): Promise<{
|
|
655
|
+
txid: string;
|
|
656
|
+
}>;
|
|
657
|
+
sendAlkanes(params: {
|
|
658
|
+
to: string;
|
|
659
|
+
alkaneid: string;
|
|
660
|
+
amount: string;
|
|
661
|
+
feeRate: number;
|
|
662
|
+
enableRBF: boolean;
|
|
663
|
+
}): Promise<string>;
|
|
664
|
+
getAlkanesCollectionList(address: string, currentPage: number, pageSize: number): Promise<{
|
|
665
|
+
list: AlkanesCollection[];
|
|
666
|
+
total: number;
|
|
667
|
+
}>;
|
|
668
|
+
getAlkanesCollectionItems(address: string, collectionId: string, currentPage: number, pageSize: number): Promise<{
|
|
669
|
+
currentPage: number;
|
|
670
|
+
pageSize: number;
|
|
671
|
+
list: AlkanesInfo[];
|
|
672
|
+
total: number;
|
|
673
|
+
}>;
|
|
674
|
+
getBRC20RecentHistory(address: string, ticker: string): Promise<BRC20HistoryItem[]>;
|
|
675
|
+
}
|
|
676
|
+
declare const WalletProvider: ({ children, wallet, }: {
|
|
677
|
+
children?: ReactNode;
|
|
678
|
+
wallet: WalletController;
|
|
679
|
+
}) => JSX.Element;
|
|
680
|
+
declare const useWallet: () => WalletController;
|
|
681
|
+
|
|
682
|
+
interface PriceContextType {
|
|
683
|
+
isLoadingCoinPrice: boolean;
|
|
684
|
+
coinPrice: CoinPrice;
|
|
685
|
+
refreshCoinPrice: () => void;
|
|
686
|
+
}
|
|
687
|
+
declare function usePrice(): PriceContextType;
|
|
688
|
+
declare function PriceProvider({ children }: {
|
|
689
|
+
children: ReactNode;
|
|
690
|
+
}): JSX.Element;
|
|
691
|
+
|
|
692
|
+
type UiTypeCheck = {
|
|
693
|
+
isTab: boolean;
|
|
694
|
+
isNotification: boolean;
|
|
695
|
+
isPop: boolean;
|
|
696
|
+
isSidePanel: boolean;
|
|
697
|
+
};
|
|
698
|
+
declare const getUiType: () => UiTypeCheck;
|
|
699
|
+
declare const useApproval: () => readonly [() => Promise<any>, (data?: any, stay?: boolean, forceReject?: boolean) => Promise<void>, (err: any, stay?: boolean, isInternal?: boolean) => Promise<void>];
|
|
700
|
+
|
|
701
|
+
declare const useAppDispatch: () => _reduxjs_toolkit.ThunkDispatch<{
|
|
702
|
+
accounts: AccountsState;
|
|
703
|
+
transactions: TransactionsState;
|
|
704
|
+
settings: SettingsState;
|
|
705
|
+
global: GlobalState;
|
|
706
|
+
keyrings: KeyringsState;
|
|
707
|
+
ui: UIState;
|
|
708
|
+
discovery: DiscoveryState;
|
|
709
|
+
}, undefined, _reduxjs_toolkit.AnyAction> & _reduxjs_toolkit.Dispatch<_reduxjs_toolkit.AnyAction>;
|
|
710
|
+
declare const useAppSelector: TypedUseSelectorHook<AppState>;
|
|
711
|
+
|
|
712
|
+
declare function useDiscoveryState(): AppState['discovery'];
|
|
713
|
+
declare function useAppList(): {
|
|
714
|
+
tab: string;
|
|
715
|
+
items: _unisat_wallet_shared.AppInfo[];
|
|
716
|
+
}[];
|
|
717
|
+
declare function useBannerList(): {
|
|
718
|
+
id: string;
|
|
719
|
+
img: string;
|
|
720
|
+
link: string;
|
|
721
|
+
}[];
|
|
722
|
+
declare function useLastFetchInfo(): {
|
|
723
|
+
lastFetchTime: number;
|
|
724
|
+
lasfFetchChainType: _unisat_wallet_types.ChainType;
|
|
725
|
+
};
|
|
726
|
+
declare function useHasNewBanner(): boolean;
|
|
727
|
+
|
|
728
|
+
declare function useGlobalState(): AppState['global'];
|
|
729
|
+
declare function useTab(): TabOption;
|
|
730
|
+
declare function useSetTabCallback(): (tab: TabOption) => void;
|
|
731
|
+
declare function useBooted(): boolean;
|
|
732
|
+
declare function useIsUnlocked(): boolean;
|
|
733
|
+
declare function useIsReady(): boolean;
|
|
734
|
+
declare function useUnlockCallback(): (password: string) => Promise<void>;
|
|
735
|
+
declare function useCreateAccountCallback(): (mnemonics: string, hdPath: string, passphrase: string, addressType: AddressType, accountCount: number) => Promise<void>;
|
|
736
|
+
declare function useImportAccountsFromKeystoneCallback(): (urType: string, urCbor: string, addressType: AddressType, accountCount: number, hdPath: string, filterPubkey?: string[], connectionType?: 'USB' | 'QR') => Promise<void>;
|
|
737
|
+
declare function useCreateColdWalletCallback(): (xpub: string, addressType: AddressType, alianName?: string, hdPath?: string, accountCount?: number) => Promise<void>;
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Use i18n Hook
|
|
741
|
+
* @returns i18n context
|
|
742
|
+
*/
|
|
743
|
+
declare const useI18n: () => any;
|
|
744
|
+
/**
|
|
745
|
+
* Get current language
|
|
746
|
+
* @returns current language code
|
|
747
|
+
*/
|
|
748
|
+
declare const getCurrentLocale: () => Promise<string>;
|
|
749
|
+
/**
|
|
750
|
+
* Select special languages for style adaptation
|
|
751
|
+
* @returns { currentLocale: string, isSpecialLocale: boolean }
|
|
752
|
+
*/
|
|
753
|
+
declare const getSpecialLocale: () => Promise<{
|
|
754
|
+
currentLocale: string;
|
|
755
|
+
isSpecialLocale: boolean;
|
|
756
|
+
}>;
|
|
757
|
+
|
|
758
|
+
declare function useKeyringsState(): AppState['keyrings'];
|
|
759
|
+
declare function useKeyrings(): _unisat_wallet_shared.WalletKeyring[];
|
|
760
|
+
declare function useCurrentKeyring(): _unisat_wallet_shared.WalletKeyring;
|
|
761
|
+
|
|
762
|
+
declare function useSettingsState(): AppState['settings'];
|
|
763
|
+
declare function useLocale(): string;
|
|
764
|
+
declare function useChangeLocaleCallback(): (locale: string) => Promise<void>;
|
|
765
|
+
declare function useNetworkType(): NetworkType;
|
|
766
|
+
declare function useChangeNetworkTypeCallback(): (type: NetworkType) => Promise<void>;
|
|
767
|
+
declare function useChainType(): ChainType;
|
|
768
|
+
declare function useChain(): _unisat_wallet_shared.TypeChain;
|
|
769
|
+
declare function useChangeChainTypeCallback(): (type: ChainType) => Promise<void>;
|
|
770
|
+
declare function useBTCUnit(): string;
|
|
771
|
+
declare function useTxExplorerUrl(txid: string): string;
|
|
772
|
+
declare function useGetTxExplorerUrlCallback(): (txid: string) => string;
|
|
773
|
+
declare function useAddressExplorerUrl(address: string): string;
|
|
774
|
+
declare function useCAT20TokenInfoExplorerUrl(version: CAT_VERSION, tokenId: string): string;
|
|
775
|
+
declare function useUnisatWebsite(): string;
|
|
776
|
+
declare function useOrdinalsWebsite(): string;
|
|
777
|
+
declare function useWalletConfig(): _unisat_wallet_shared.WalletConfig;
|
|
778
|
+
declare function useVersionInfo(): {
|
|
779
|
+
currentVesion: string;
|
|
780
|
+
newVersion: string;
|
|
781
|
+
latestVersion: string;
|
|
782
|
+
skipped: boolean;
|
|
783
|
+
};
|
|
784
|
+
declare function useSkipVersionCallback(): (version: string) => void;
|
|
785
|
+
declare function useAutoLockTimeId(): number;
|
|
786
|
+
declare function getAddressTips(address: string, chanEnum: ChainType): {
|
|
787
|
+
homeTip: string;
|
|
788
|
+
sendTip: string;
|
|
789
|
+
};
|
|
790
|
+
declare function useAddressTips(): {
|
|
791
|
+
homeTip: string;
|
|
792
|
+
sendTip: string;
|
|
793
|
+
};
|
|
794
|
+
declare function useCAT721NFTContentBaseUrl(version: CAT_VERSION): "" | "https://tracker-fractal-mainnet.catprotocol.org" | "https://tracker2-fractal-mainnet.catprotocol.org" | "https://tracker-fractal-testnet.catprotocol.org";
|
|
795
|
+
declare function useBRC20MarketPlaceWebsite(ticker: string): string;
|
|
796
|
+
declare function useRunesMarketPlaceWebsite(ticker: string): string;
|
|
797
|
+
declare function useCAT20MarketPlaceWebsite(tokenId: string): string;
|
|
798
|
+
declare function useBabylonConfig(): _unisat_babylon_service_types.BabylonConfig;
|
|
799
|
+
declare function useIsMainnetChain(): boolean;
|
|
800
|
+
declare function useDeveloperMode(): boolean;
|
|
801
|
+
declare function useSetDeveloperModeCallback(): (developerMode: boolean) => Promise<void>;
|
|
802
|
+
|
|
803
|
+
declare function useTransactionsState(): AppState['transactions'];
|
|
804
|
+
declare function useBitcoinTx(): BitcoinTx;
|
|
805
|
+
declare function usePrepareSendBTCCallback(): ({ toAddressInfo, toAmount, feeRate, enableRBF, memo, memos, disableAutoAdjust, }: {
|
|
806
|
+
toAddressInfo: ToAddressInfo;
|
|
807
|
+
toAmount: number;
|
|
808
|
+
feeRate?: number;
|
|
809
|
+
enableRBF: boolean;
|
|
810
|
+
memo?: string;
|
|
811
|
+
memos?: string[];
|
|
812
|
+
disableAutoAdjust?: boolean;
|
|
813
|
+
}) => Promise<RawTxInfo>;
|
|
814
|
+
declare function usePrepareSendBypassHeadOffsetsCallback(): ({ toAddressInfo, toAmount, feeRate, }: {
|
|
815
|
+
toAddressInfo: ToAddressInfo;
|
|
816
|
+
toAmount: number;
|
|
817
|
+
feeRate: number;
|
|
818
|
+
}) => Promise<RawTxInfo>;
|
|
819
|
+
declare function usePushBitcoinTxCallback(): (rawtx: string) => Promise<{
|
|
820
|
+
success: boolean;
|
|
821
|
+
txid: string;
|
|
822
|
+
error: string;
|
|
823
|
+
}>;
|
|
824
|
+
declare function useOrdinalsTx(): OrdinalsTx;
|
|
825
|
+
declare function usePrepareSendOrdinalsInscriptionCallback(): ({ toAddressInfo, inscriptionId, feeRate, outputValue, enableRBF, }: {
|
|
826
|
+
toAddressInfo: ToAddressInfo;
|
|
827
|
+
inscriptionId: string;
|
|
828
|
+
feeRate?: number;
|
|
829
|
+
outputValue?: number;
|
|
830
|
+
enableRBF: boolean;
|
|
831
|
+
}) => Promise<RawTxInfo>;
|
|
832
|
+
declare function usePrepareSendOrdinalsInscriptionsCallback(): ({ toAddressInfo, inscriptionIds, feeRate, enableRBF, }: {
|
|
833
|
+
toAddressInfo: ToAddressInfo;
|
|
834
|
+
inscriptionIds: string[];
|
|
835
|
+
feeRate?: number;
|
|
836
|
+
enableRBF: boolean;
|
|
837
|
+
}) => Promise<RawTxInfo>;
|
|
838
|
+
declare function useCreateSplitTxCallback(): ({ inscriptionId, feeRate, outputValue, enableRBF, }: {
|
|
839
|
+
inscriptionId: string;
|
|
840
|
+
feeRate: number;
|
|
841
|
+
outputValue: number;
|
|
842
|
+
enableRBF: boolean;
|
|
843
|
+
}) => Promise<{
|
|
844
|
+
rawTxInfo: RawTxInfo;
|
|
845
|
+
splitedCount: number;
|
|
846
|
+
}>;
|
|
847
|
+
declare function usePushOrdinalsTxCallback(): (rawtx: string) => Promise<{
|
|
848
|
+
success: boolean;
|
|
849
|
+
txid: string;
|
|
850
|
+
error: string;
|
|
851
|
+
}>;
|
|
852
|
+
declare function useUtxos(): UnspentOutput[];
|
|
853
|
+
declare function useFetchUtxosCallback(): () => Promise<UnspentOutput[]>;
|
|
854
|
+
declare function useSpendUnavailableUtxos(): UnspentOutput[];
|
|
855
|
+
declare function useSetSpendUnavailableUtxosCallback(): (utxos: UnspentOutput[]) => void;
|
|
856
|
+
declare function useSafeBalance(): string;
|
|
857
|
+
declare function useAssetUtxosRunes(): UnspentOutput[];
|
|
858
|
+
declare function useFetchAssetUtxosRunesCallback(): (rune: string) => Promise<UnspentOutput[]>;
|
|
859
|
+
declare function usePrepareSendRunesCallback(): ({ toAddressInfo, runeid, runeAmount, outputValue, feeRate, enableRBF, }: {
|
|
860
|
+
toAddressInfo: ToAddressInfo;
|
|
861
|
+
runeid: string;
|
|
862
|
+
runeAmount: string;
|
|
863
|
+
outputValue?: number;
|
|
864
|
+
feeRate: number;
|
|
865
|
+
enableRBF: boolean;
|
|
866
|
+
}) => Promise<RawTxInfo>;
|
|
867
|
+
declare function useRunesTx(): RunesTx;
|
|
868
|
+
declare function usePrepareSendAlkanesCallback(): (toAddressInfo: ToAddressInfo, alkaneid: string, amount: string, feeRate: number, enableRBF?: boolean) => Promise<string>;
|
|
869
|
+
|
|
870
|
+
declare function useUIState(): AppState['ui'];
|
|
871
|
+
declare function useAssetTabKey(): AssetTabKey;
|
|
872
|
+
declare function useOrdinalsAssetTabKey(): OrdinalsAssetTabKey;
|
|
873
|
+
declare function useCATAssetTabKey(): CATAssetTabKey;
|
|
874
|
+
declare function useAlkanesAssetTabKey(): AlkanesAssetTabKey;
|
|
875
|
+
declare function useUiTxCreateScreen(): {
|
|
876
|
+
toInfo: {
|
|
877
|
+
address: string;
|
|
878
|
+
domain: string;
|
|
879
|
+
inscription?: Inscription;
|
|
880
|
+
};
|
|
881
|
+
inputAmount: string;
|
|
882
|
+
enableRBF: boolean;
|
|
883
|
+
feeRate: number;
|
|
884
|
+
};
|
|
885
|
+
declare function useUpdateUiTxCreateScreen(): ({ toInfo, inputAmount, enableRBF, feeRate, }: {
|
|
886
|
+
toInfo?: {
|
|
887
|
+
address: string;
|
|
888
|
+
domain: string;
|
|
889
|
+
inscription?: Inscription;
|
|
890
|
+
};
|
|
891
|
+
inputAmount?: string;
|
|
892
|
+
enableRBF?: boolean;
|
|
893
|
+
feeRate?: number;
|
|
894
|
+
}) => void;
|
|
895
|
+
declare function useResetUiTxCreateScreen(): () => void;
|
|
896
|
+
declare function useSupportedAssets(): {
|
|
897
|
+
tabKeys: AssetTabKey[];
|
|
898
|
+
assets: {
|
|
899
|
+
ordinals: boolean;
|
|
900
|
+
runes: boolean;
|
|
901
|
+
CAT20: boolean;
|
|
902
|
+
alkanes: boolean;
|
|
903
|
+
};
|
|
904
|
+
key: string;
|
|
905
|
+
};
|
|
906
|
+
declare const useIsInExpandView: () => boolean;
|
|
907
|
+
declare const useUtxoTools: (chain: TypeChain) => {
|
|
908
|
+
openUtxoTools: () => void;
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
declare function AccountUpdater(): any;
|
|
912
|
+
|
|
913
|
+
declare const store: _reduxjs_toolkit_dist_configureStore.ToolkitStore<{
|
|
914
|
+
accounts: AccountsState;
|
|
915
|
+
transactions: TransactionsState;
|
|
916
|
+
settings: SettingsState;
|
|
917
|
+
global: GlobalState;
|
|
918
|
+
keyrings: KeyringsState;
|
|
919
|
+
ui: UIState;
|
|
920
|
+
discovery: DiscoveryState;
|
|
921
|
+
}, _reduxjs_toolkit.AnyAction, _reduxjs_toolkit.MiddlewareArray<[_reduxjs_toolkit.ThunkMiddleware<{
|
|
922
|
+
accounts: AccountsState;
|
|
923
|
+
transactions: TransactionsState;
|
|
924
|
+
settings: SettingsState;
|
|
925
|
+
global: GlobalState;
|
|
926
|
+
keyrings: KeyringsState;
|
|
927
|
+
ui: UIState;
|
|
928
|
+
discovery: DiscoveryState;
|
|
929
|
+
}, _reduxjs_toolkit.AnyAction>, _reduxjs_toolkit.Middleware<{}, any, _reduxjs_toolkit.Dispatch<_reduxjs_toolkit.AnyAction>>]>>;
|
|
930
|
+
|
|
931
|
+
type AppState = ReturnType<typeof store.getState>;
|
|
932
|
+
type AppDispatch = typeof store.dispatch;
|
|
933
|
+
|
|
934
|
+
export { AccountUpdater, AppDispatch, AppState, I18nProvider, PriceProvider, WalletProvider, store as default, getAddressTips, getCurrentLocale, getSpecialLocale, getUiType, useAddressExplorerUrl, useAddressTips, useAlkanesAssetTabKey, useAppDispatch, useAppList, useAppSelector, useApproval, useAssetTabKey, useAssetUtxosRunes, useAutoLockTimeId, useBRC20MarketPlaceWebsite, useBTCUnit, useBabylonConfig, useBannerList, useBitcoinTx, useBooted, useCAT20MarketPlaceWebsite, useCAT20TokenInfoExplorerUrl, useCAT721NFTContentBaseUrl, useCATAssetTabKey, useChain, useChainType, useChangeChainTypeCallback, useChangeLocaleCallback, useChangeNetworkTypeCallback, useCreateAccountCallback, useCreateColdWalletCallback, useCreateSplitTxCallback, useCurrentKeyring, useDeveloperMode, useDiscoveryState, useFetchAssetUtxosRunesCallback, useFetchUtxosCallback, useGetTxExplorerUrlCallback, useGlobalState, useHasNewBanner, useI18n, useImportAccountsFromKeystoneCallback, useIsInExpandView, useIsMainnetChain, useIsReady, useIsUnlocked, useKeyrings, useKeyringsState, useLastFetchInfo, useLocale, useNetworkType, useOrdinalsAssetTabKey, useOrdinalsTx, useOrdinalsWebsite, usePrepareSendAlkanesCallback, usePrepareSendBTCCallback, usePrepareSendBypassHeadOffsetsCallback, usePrepareSendOrdinalsInscriptionCallback, usePrepareSendOrdinalsInscriptionsCallback, usePrepareSendRunesCallback, usePrice, usePushBitcoinTxCallback, usePushOrdinalsTxCallback, useResetUiTxCreateScreen, useRunesMarketPlaceWebsite, useRunesTx, useSafeBalance, useSetDeveloperModeCallback, useSetSpendUnavailableUtxosCallback, useSetTabCallback, useSettingsState, useSkipVersionCallback, useSpendUnavailableUtxos, useSupportedAssets, useTab, useTransactionsState, useTxExplorerUrl, useUIState, useUiTxCreateScreen, useUnisatWebsite, useUnlockCallback, useUpdateUiTxCreateScreen, useUtxoTools, useUtxos, useVersionInfo, useWallet, useWalletConfig };
|