btc-wallet 0.5.11-beta → 0.5.13-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 +4 -1
- package/dist/core/btcUtils.d.ts +17 -9
- package/dist/index.js +270 -146
- package/dist/index.js.map +2 -2
- package/dist/utils/nearUtils.d.ts +7 -1
- package/dist/utils/request.d.ts +1 -0
- package/esm/index.js +270 -146
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
export type ENV = 'mainnet' | 'testnet' | 'private_mainnet' | 'dev';
|
2
2
|
export declare const walletConfig: Record<ENV, {
|
3
3
|
base_url: string;
|
4
|
-
|
4
|
+
btcToken: string;
|
5
|
+
btcTokenDecimals: number;
|
6
|
+
nearToken: string;
|
7
|
+
nearTokenDecimals: number;
|
5
8
|
accountContractId: string;
|
6
9
|
bridgeContractId: string;
|
7
10
|
walletUrl: string;
|
package/dist/core/btcUtils.d.ts
CHANGED
@@ -2,7 +2,10 @@ import type { ENV } from '../config';
|
|
2
2
|
import type { FinalExecutionOutcome, Transaction } from '@near-wallet-selector/core';
|
3
3
|
export declare function getConfig(env: ENV): Promise<{
|
4
4
|
base_url: string;
|
5
|
-
|
5
|
+
btcToken: string;
|
6
|
+
btcTokenDecimals: number;
|
7
|
+
nearToken: string;
|
8
|
+
nearTokenDecimals: number;
|
6
9
|
accountContractId: string;
|
7
10
|
bridgeContractId: string;
|
8
11
|
walletUrl: string;
|
@@ -20,8 +23,19 @@ export interface AccountInfo {
|
|
20
23
|
amount?: string;
|
21
24
|
};
|
22
25
|
}
|
23
|
-
export declare function getAccountInfo(csna
|
24
|
-
|
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>;
|
25
39
|
type CheckGasTokenDebtReturnType<T extends boolean> = T extends true ? void : {
|
26
40
|
receiver_id: string;
|
27
41
|
amount: string;
|
@@ -34,12 +48,6 @@ export declare function getBtcBalance(): Promise<{
|
|
34
48
|
balance: number;
|
35
49
|
availableBalance: number;
|
36
50
|
}>;
|
37
|
-
export declare function getNBTCBalance(address: string, env?: ENV): Promise<{
|
38
|
-
balance: number;
|
39
|
-
availableBalance: number;
|
40
|
-
rawBalance: string;
|
41
|
-
rawAvailableBalance: number;
|
42
|
-
}>;
|
43
51
|
export declare function sendBitcoin(address: string, amount: number, feeRate: number): Promise<string>;
|
44
52
|
/** estimate deposit receive amount, deduct protocol fee and repay amount */
|
45
53
|
export declare function estimateDepositAmount(amount: string, option?: {
|