btc-wallet 0.5.15-beta → 0.5.17-beta

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/dist/config.d.ts CHANGED
@@ -10,6 +10,18 @@ export declare const walletConfig: Record<ENV, {
10
10
  walletUrl: string;
11
11
  bridgeUrl: string;
12
12
  }>;
13
+ export declare function getWalletConfig(env: ENV): {
14
+ network: string;
15
+ base_url: string;
16
+ btcToken: string;
17
+ btcTokenDecimals: number;
18
+ nearToken: string;
19
+ nearTokenDecimals: number;
20
+ accountContractId: string;
21
+ bridgeContractId: string;
22
+ walletUrl: string;
23
+ bridgeUrl: string;
24
+ };
13
25
  export declare const nearRpcUrls: {
14
26
  mainnet: string[];
15
27
  testnet: string[];
@@ -1,47 +1,11 @@
1
1
  import type { ENV } from '../config';
2
2
  import type { FinalExecutionOutcome, Transaction } from '@near-wallet-selector/core';
3
- export declare function getConfig(env: ENV): Promise<{
4
- base_url: string;
5
- btcToken: string;
6
- btcTokenDecimals: number;
7
- nearToken: string;
8
- nearTokenDecimals: number;
9
- accountContractId: string;
10
- bridgeContractId: string;
11
- walletUrl: string;
12
- bridgeUrl: string;
13
- }>;
14
- export interface AccountInfo {
15
- nonce: string;
16
- gas_token: Record<string, string>;
17
- debt_info?: {
18
- gas_token_id: string;
19
- near_gas_debt_amount: string;
20
- protocol_fee_debt_amount: string;
21
- };
22
- relayer_fee?: {
23
- amount?: string;
24
- };
25
- }
26
- export declare function getAccountInfo({ csna, env }: {
27
- csna: string;
28
- env: ENV;
29
- }): Promise<AccountInfo | undefined>;
30
- export declare function getTokenBalance({ csna, tokenId, env, }: {
31
- csna: string;
32
- tokenId: string;
33
- env: ENV;
34
- }): Promise<{
35
- balance: number;
36
- rawBalance: string;
37
- }>;
38
- export declare function checkGasTokenBalance(csna: string, minAmount: string, env: ENV): Promise<void>;
39
3
  type CheckGasTokenDebtReturnType<T extends boolean> = T extends true ? void : {
40
4
  receiver_id: string;
41
5
  amount: string;
42
6
  msg: string;
43
7
  } | undefined;
44
- export declare function checkGasTokenDebt<T extends boolean>(accountInfo: AccountInfo | undefined, env: ENV, autoDeposit?: T): Promise<CheckGasTokenDebtReturnType<T>>;
8
+ export declare function checkGasTokenDebt<T extends boolean>(csna: string, env: ENV, autoDeposit?: T): Promise<CheckGasTokenDebtReturnType<T>>;
45
9
  export declare function getBtcGasPrice(): Promise<number>;
46
10
  export declare function getBtcBalance(): Promise<{
47
11
  rawBalance: number;
@@ -1,6 +1,6 @@
1
1
  import type { InjectedWallet, WalletModuleFactory } from '@near-wallet-selector/core';
2
- import type { useBtcWalletSelector } from './btcWalletSelectorContext';
3
- import type { ENV } from '../config';
2
+ import type { useBtcWalletSelector } from '../btcWalletSelectorContext';
3
+ import type { ENV } from '../../config';
4
4
  declare global {
5
5
  interface Window {
6
6
  btcContext: ReturnType<typeof useBtcWalletSelector>;
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ saveAccount(account: string): void;
3
+ removeAccount(): void;
4
+ savePublicKey(publicKey: string): void;
5
+ removePublicKey(): void;
6
+ saveBtcPublicKey(publicKey: string): void;
7
+ removeBtcPublicKey(): void;
8
+ clear(): void;
9
+ save(account: string, publicKey: string): void;
10
+ getAccount(): string;
11
+ getPublicKey(): string;
12
+ getBtcPublicKey(): string;
13
+ isValid(): string | true;
14
+ syncSave(account: string, publicKey: string, btcPublicKey: string): void;
15
+ };
16
+ export default _default;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './connector';
2
2
  export { ConnectProvider } from './context';
3
3
  export * from './hooks';
4
4
  export * from './core/btcWalletSelectorContext';
5
- export * from './core/setupBTCWallet';
5
+ export * from './core/setupBTCWallet/index';
6
6
  export * from './core/btcUtils';
7
+ export * from './config';
7
8
  export declare const getVersion: () => string;