btc-wallet 0.3.11 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/config.d.ts +0 -1
- package/dist/core/btcUtils.d.ts +31 -10
- package/dist/index.js +621 -340
- package/dist/index.js.map +4 -4
- package/dist/utils/Dialog.d.ts +13 -0
- package/dist/utils/request.d.ts +1 -1
- package/dist/utils/satoshi.d.ts +18 -0
- package/esm/index.js +619 -338
- package/esm/index.js.map +4 -4
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
package/dist/core/btcUtils.d.ts
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
export interface DebtInfo {
|
2
|
+
gas_token_id: string;
|
3
|
+
transfer_amount: string;
|
4
|
+
near_gas_debt_amount: string;
|
5
|
+
protocol_fee_debt_amount: string;
|
6
|
+
}
|
7
|
+
export declare function getAccountInfo(csna: string, accountContractId: string): Promise<{
|
8
|
+
nonce: string;
|
9
|
+
gas_token: Record<string, string>;
|
10
|
+
debt_info: DebtInfo;
|
11
|
+
}>;
|
12
|
+
export declare function checkGasTokenArrears(debtInfo: DebtInfo, isDev: boolean, autoDeposit?: boolean): Promise<{
|
13
|
+
receiver_id: string;
|
14
|
+
amount: string;
|
15
|
+
msg: string;
|
16
|
+
} | undefined>;
|
1
17
|
export declare function getBtcGasPrice(): Promise<number>;
|
2
18
|
export declare function getBtcBalance(): Promise<{
|
3
19
|
rawBalance: number;
|
@@ -12,24 +28,29 @@ export declare function getBtcBalance(): Promise<{
|
|
12
28
|
}>;
|
13
29
|
export declare function sendBitcoin(address: string, amount: number, feeRate: number): Promise<string>;
|
14
30
|
export declare function estimateDepositAmount(amount: string, option?: {
|
15
|
-
isDev
|
16
|
-
}): Promise<
|
31
|
+
isDev?: boolean;
|
32
|
+
}): Promise<number>;
|
33
|
+
export declare function getDepositAmount(amount: string, option?: {
|
34
|
+
isEstimate?: boolean;
|
35
|
+
isDev?: boolean;
|
36
|
+
}): Promise<{
|
37
|
+
depositAmount: number;
|
38
|
+
receiveAmount: number;
|
39
|
+
fee: number;
|
40
|
+
}>;
|
17
41
|
interface ExecuteBTCDepositAndActionParams {
|
18
|
-
action
|
42
|
+
action?: {
|
19
43
|
receiver_id: string;
|
20
44
|
amount: string;
|
21
45
|
msg: string;
|
22
46
|
};
|
47
|
+
amount?: string;
|
23
48
|
/** fee rate, if not provided, will use the recommended fee rate from the btc node */
|
24
49
|
feeRate?: number;
|
50
|
+
/** fixed amount, if true, in arrears mode, amount is fixed, otherwise it is depositAmount-repayAction.amount */
|
51
|
+
fixedAmount?: boolean;
|
25
52
|
/** is dev environment */
|
26
53
|
isDev?: boolean;
|
27
54
|
}
|
28
|
-
export declare function executeBTCDepositAndAction({ action, feeRate, isDev, }: ExecuteBTCDepositAndActionParams): Promise<
|
29
|
-
result: string;
|
30
|
-
error?: undefined;
|
31
|
-
} | {
|
32
|
-
result: string;
|
33
|
-
error: any;
|
34
|
-
}>;
|
55
|
+
export declare function executeBTCDepositAndAction({ action, amount, feeRate, fixedAmount, isDev, }: ExecuteBTCDepositAndActionParams): Promise<any[]>;
|
35
56
|
export {};
|