btc-wallet 0.3.28 → 0.3.29
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -1
- package/dist/core/btcUtils.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +2 -2
- package/esm/index.js +3 -2
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -69,6 +69,7 @@ interface ExecuteBTCDepositAndActionParams<T extends boolean = true> {
|
|
69
69
|
fixedAmount?: boolean; // optional: whether to use fixed amount
|
70
70
|
env?: 'mainnet' | 'testnet' | 'private_mainnet' | 'dev'; // optional: defaults to NEAR network environment
|
71
71
|
pollResult?: T; // optional: whether to poll for transaction result
|
72
|
+
registerDeposit?: string; // optional: whether to register deposit,default 0.000125 NEAR
|
72
73
|
}
|
73
74
|
|
74
75
|
// Example 1: dApp one-click BTC deposit
|
@@ -78,7 +79,8 @@ await executeBTCDepositAndAction({
|
|
78
79
|
amount: '1000000', // in smallest units
|
79
80
|
msg: 'Deposit'
|
80
81
|
},
|
81
|
-
feeRate: 5
|
82
|
+
feeRate: 5,
|
83
|
+
registerDeposit: '100000000000000000000000', // default 0.000125 NEAR, you can set it according to your needs
|
82
84
|
});
|
83
85
|
|
84
86
|
// Example 2: Direct Satoshi bridge deposit
|
package/dist/core/btcUtils.d.ts
CHANGED
@@ -51,6 +51,8 @@ interface ExecuteBTCDepositAndActionParams<T extends boolean = true> {
|
|
51
51
|
msg: string;
|
52
52
|
};
|
53
53
|
amount?: string;
|
54
|
+
/** if registerDeposit is true, It will consume the deposit, otherwise it will be 0.000125 NEAR */
|
55
|
+
registerDeposit?: string;
|
54
56
|
feeRate?: number;
|
55
57
|
fixedAmount?: boolean;
|
56
58
|
env?: ENV;
|
@@ -60,5 +62,5 @@ interface ExecuteBTCDepositAndActionParams<T extends boolean = true> {
|
|
60
62
|
* @param T - if true, return the poll result, otherwise return the btcTxHash
|
61
63
|
*/
|
62
64
|
type ExecuteBTCDepositAndActionReturn<T extends boolean> = T extends true ? FinalExecutionOutcome[] : string;
|
63
|
-
export declare function executeBTCDepositAndAction<T extends boolean = true>({ action, amount, feeRate, fixedAmount, pollResult, env, }: ExecuteBTCDepositAndActionParams<T>): Promise<ExecuteBTCDepositAndActionReturn<T>>;
|
65
|
+
export declare function executeBTCDepositAndAction<T extends boolean = true>({ action, amount, feeRate, fixedAmount, pollResult, registerDeposit, env, }: ExecuteBTCDepositAndActionParams<T>): Promise<ExecuteBTCDepositAndActionReturn<T>>;
|
64
66
|
export {};
|
package/dist/index.js
CHANGED
@@ -3419,6 +3419,7 @@ function executeBTCDepositAndAction(_0) {
|
|
3419
3419
|
feeRate,
|
3420
3420
|
fixedAmount = true,
|
3421
3421
|
pollResult = true,
|
3422
|
+
registerDeposit,
|
3422
3423
|
env = "mainnet"
|
3423
3424
|
}) {
|
3424
3425
|
var _a;
|
@@ -3468,7 +3469,7 @@ function executeBTCDepositAndAction(_0) {
|
|
3468
3469
|
if (!(registerRes == null ? void 0 : registerRes.available)) {
|
3469
3470
|
storageDepositMsg.storage_deposit_msg = {
|
3470
3471
|
contract_id: (action == null ? void 0 : action.receiver_id) || config.token,
|
3471
|
-
deposit: NEAR_STORAGE_DEPOSIT_AMOUNT,
|
3472
|
+
deposit: registerDeposit || NEAR_STORAGE_DEPOSIT_AMOUNT,
|
3472
3473
|
registration_only: true
|
3473
3474
|
};
|
3474
3475
|
}
|
@@ -4000,7 +4001,7 @@ function setupBTCWallet({
|
|
4000
4001
|
|
4001
4002
|
// src/index.ts
|
4002
4003
|
var getVersion = () => {
|
4003
|
-
return "0.3.
|
4004
|
+
return "0.3.29";
|
4004
4005
|
};
|
4005
4006
|
if (typeof window !== "undefined") {
|
4006
4007
|
window.__BTC_WALLET_VERSION = getVersion();
|