btc-wallet 0.5.95-beta → 0.5.96-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/core/btcUtils.d.ts +4 -2
 - package/dist/index.js +11 -2
 - package/dist/index.js.map +3 -3
 - package/esm/index.js +11 -2
 - package/esm/index.js.map +3 -3
 - package/package.json +1 -1
 
    
        package/dist/core/btcUtils.d.ts
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            import type { ENV } from '../config';
         
     | 
| 
       2 
     | 
    
         
            -
            import { checkBridgeTransactionStatus, calculateGasLimit } from '../utils/satoshi';
         
     | 
| 
      
 2 
     | 
    
         
            +
            import { checkBridgeTransactionStatus, calculateGasLimit, calculateGasStrategy } from '../utils/satoshi';
         
     | 
| 
       3 
3 
     | 
    
         
             
            import type { FinalExecutionOutcome, Transaction } from '@near-wallet-selector/core';
         
     | 
| 
       4 
     | 
    
         
            -
            export { calculateGasLimit, checkBridgeTransactionStatus };
         
     | 
| 
      
 4 
     | 
    
         
            +
            export { calculateGasLimit, calculateGasStrategy, checkBridgeTransactionStatus };
         
     | 
| 
       5 
5 
     | 
    
         
             
            type CheckGasTokenDebtReturnType<T extends boolean> = T extends true ? void : {
         
     | 
| 
       6 
6 
     | 
    
         
             
                receiver_id: string;
         
     | 
| 
       7 
7 
     | 
    
         
             
                amount: string;
         
     | 
| 
         @@ -30,6 +30,8 @@ export declare function sendBitcoin(address: string, amount: number, feeRate: nu 
     | 
|
| 
       30 
30 
     | 
    
         
             
            export declare function signMessage(message: string): Promise<{
         
     | 
| 
       31 
31 
     | 
    
         
             
                signature: string;
         
     | 
| 
       32 
32 
     | 
    
         
             
                publicKey: string;
         
     | 
| 
      
 33 
     | 
    
         
            +
                signatureBase58: any;
         
     | 
| 
      
 34 
     | 
    
         
            +
                publicKeyBase58: any;
         
     | 
| 
       33 
35 
     | 
    
         
             
            }>;
         
     | 
| 
       34 
36 
     | 
    
         
             
            /** estimate deposit receive amount, deduct protocol fee and repay amount */
         
     | 
| 
       35 
37 
     | 
    
         
             
            export declare function estimateDepositAmount(amount: string, option?: {
         
     | 
    
        package/dist/index.js
    CHANGED
    
    | 
         @@ -107,6 +107,7 @@ __export(src_exports, { 
     | 
|
| 
       107 
107 
     | 
    
         
             
              btcRpcUrls: () => btcRpcUrls,
         
     | 
| 
       108 
108 
     | 
    
         
             
              calculateGasFee: () => calculateGasFee,
         
     | 
| 
       109 
109 
     | 
    
         
             
              calculateGasLimit: () => calculateGasLimit,
         
     | 
| 
      
 110 
     | 
    
         
            +
              calculateGasStrategy: () => calculateGasStrategy,
         
     | 
| 
       110 
111 
     | 
    
         
             
              calculateWithdraw: () => calculateWithdraw,
         
     | 
| 
       111 
112 
     | 
    
         
             
              checkBridgeTransactionStatus: () => checkBridgeTransactionStatus,
         
     | 
| 
       112 
113 
     | 
    
         
             
              checkGasTokenDebt: () => checkGasTokenDebt,
         
     | 
| 
         @@ -3829,6 +3830,7 @@ function getPredictedGasAmount(_0) { 
     | 
|
| 
       3829 
3830 
     | 
    
         
             
            var bitcoin = __toESM(require("bitcoinjs-lib"), 1);
         
     | 
| 
       3830 
3831 
     | 
    
         
             
            var import_coinselect = __toESM(require("coinselect"), 1);
         
     | 
| 
       3831 
3832 
     | 
    
         
             
            var ecc = __toESM(require("@bitcoinerlab/secp256k1"), 1);
         
     | 
| 
      
 3833 
     | 
    
         
            +
            var import_bs582 = __toESM(require("bs58"), 1);
         
     | 
| 
       3832 
3834 
     | 
    
         
             
            bitcoin.initEccLib(ecc);
         
     | 
| 
       3833 
3835 
     | 
    
         
             
            var NEAR_STORAGE_DEPOSIT_AMOUNT = "1250000000000000000000";
         
     | 
| 
       3834 
3836 
     | 
    
         
             
            var NBTC_STORAGE_DEPOSIT_AMOUNT = 800;
         
     | 
| 
         @@ -3978,7 +3980,14 @@ function signMessage(message) { 
     | 
|
| 
       3978 
3980 
     | 
    
         
             
                const { signMessage: signMessage2, getPublicKey } = getBtcProvider();
         
     | 
| 
       3979 
3981 
     | 
    
         
             
                const publicKey = yield getPublicKey();
         
     | 
| 
       3980 
3982 
     | 
    
         
             
                const signature = yield signMessage2(message);
         
     | 
| 
       3981 
     | 
    
         
            -
                 
     | 
| 
      
 3983 
     | 
    
         
            +
                const signatureBase58 = import_bs582.default.encode(Buffer.from(signature, "base64"));
         
     | 
| 
      
 3984 
     | 
    
         
            +
                const publicKeyBase58 = import_bs582.default.encode(Buffer.from(publicKey, "hex"));
         
     | 
| 
      
 3985 
     | 
    
         
            +
                return {
         
     | 
| 
      
 3986 
     | 
    
         
            +
                  signature,
         
     | 
| 
      
 3987 
     | 
    
         
            +
                  publicKey,
         
     | 
| 
      
 3988 
     | 
    
         
            +
                  signatureBase58,
         
     | 
| 
      
 3989 
     | 
    
         
            +
                  publicKeyBase58
         
     | 
| 
      
 3990 
     | 
    
         
            +
                };
         
     | 
| 
       3982 
3991 
     | 
    
         
             
              });
         
     | 
| 
       3983 
3992 
     | 
    
         
             
            }
         
     | 
| 
       3984 
3993 
     | 
    
         
             
            function estimateDepositAmount(amount, option) {
         
     | 
| 
         @@ -5425,7 +5434,7 @@ function getGroup(state) { 
     | 
|
| 
       5425 
5434 
     | 
    
         | 
| 
       5426 
5435 
     | 
    
         
             
            // src/index.ts
         
     | 
| 
       5427 
5436 
     | 
    
         
             
            var getVersion = () => {
         
     | 
| 
       5428 
     | 
    
         
            -
              return "0.5. 
     | 
| 
      
 5437 
     | 
    
         
            +
              return "0.5.96-beta";
         
     | 
| 
       5429 
5438 
     | 
    
         
             
            };
         
     | 
| 
       5430 
5439 
     | 
    
         
             
            if (typeof window !== "undefined") {
         
     | 
| 
       5431 
5440 
     | 
    
         
             
              window.__BTC_WALLET_VERSION = getVersion();
         
     |