btc-wallet 0.5.98-beta → 0.5.99-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 +1 -2
 - package/dist/index.js +13 -20
 - package/dist/index.js.map +3 -3
 - package/esm/index.js +13 -20
 - package/esm/index.js.map +3 -3
 - package/package.json +1 -1
 
    
        package/esm/index.js
    CHANGED
    
    | 
         @@ -3901,21 +3901,10 @@ function sendBitcoin(address, amount, feeRate) { 
     | 
|
| 
       3901 
3901 
     | 
    
         
             
                return txHash;
         
     | 
| 
       3902 
3902 
     | 
    
         
             
              });
         
     | 
| 
       3903 
3903 
     | 
    
         
             
            }
         
     | 
| 
       3904 
     | 
    
         
            -
            function  
     | 
| 
      
 3904 
     | 
    
         
            +
            function getPublicKeyBase58() {
         
     | 
| 
       3905 
3905 
     | 
    
         
             
              return __async(this, null, function* () {
         
     | 
| 
       3906 
     | 
    
         
            -
                const {  
     | 
| 
      
 3906 
     | 
    
         
            +
                const { getPublicKey } = getBtcProvider();
         
     | 
| 
       3907 
3907 
     | 
    
         
             
                const publicKey = yield getPublicKey();
         
     | 
| 
       3908 
     | 
    
         
            -
                const signature = yield signMessage2(message);
         
     | 
| 
       3909 
     | 
    
         
            -
                const signatureBuffer = Buffer.from(signature, "base64");
         
     | 
| 
       3910 
     | 
    
         
            -
                let signatureWithoutPrefix;
         
     | 
| 
       3911 
     | 
    
         
            -
                if (signatureBuffer.length === 65) {
         
     | 
| 
       3912 
     | 
    
         
            -
                  signatureWithoutPrefix = signatureBuffer.subarray(1);
         
     | 
| 
       3913 
     | 
    
         
            -
                } else if (signatureBuffer.length === 64) {
         
     | 
| 
       3914 
     | 
    
         
            -
                  signatureWithoutPrefix = signatureBuffer;
         
     | 
| 
       3915 
     | 
    
         
            -
                } else {
         
     | 
| 
       3916 
     | 
    
         
            -
                  throw new Error(`Invalid signature length: ${signatureBuffer.length}`);
         
     | 
| 
       3917 
     | 
    
         
            -
                }
         
     | 
| 
       3918 
     | 
    
         
            -
                const signatureBase58 = bs582.encode(signatureWithoutPrefix);
         
     | 
| 
       3919 
3908 
     | 
    
         
             
                const publicKeyBuffer = Buffer.from(publicKey, "hex");
         
     | 
| 
       3920 
3909 
     | 
    
         
             
                let uncompressedPublicKey;
         
     | 
| 
       3921 
3910 
     | 
    
         
             
                if (publicKeyBuffer.length === 33) {
         
     | 
| 
         @@ -3931,12 +3920,15 @@ function signMessage(message) { 
     | 
|
| 
       3931 
3920 
     | 
    
         
             
                }
         
     | 
| 
       3932 
3921 
     | 
    
         
             
                const publicKeyWithoutPrefix = uncompressedPublicKey.subarray(1);
         
     | 
| 
       3933 
3922 
     | 
    
         
             
                const publicKeyBase58 = bs582.encode(publicKeyWithoutPrefix);
         
     | 
| 
       3934 
     | 
    
         
            -
                return  
     | 
| 
       3935 
     | 
    
         
            -
             
     | 
| 
       3936 
     | 
    
         
            -
             
     | 
| 
       3937 
     | 
    
         
            -
             
     | 
| 
       3938 
     | 
    
         
            -
             
     | 
| 
       3939 
     | 
    
         
            -
                };
         
     | 
| 
      
 3923 
     | 
    
         
            +
                return publicKeyBase58;
         
     | 
| 
      
 3924 
     | 
    
         
            +
              });
         
     | 
| 
      
 3925 
     | 
    
         
            +
            }
         
     | 
| 
      
 3926 
     | 
    
         
            +
            function signMessage(message) {
         
     | 
| 
      
 3927 
     | 
    
         
            +
              return __async(this, null, function* () {
         
     | 
| 
      
 3928 
     | 
    
         
            +
                const { signMessage: signMessage2, getPublicKey } = getBtcProvider();
         
     | 
| 
      
 3929 
     | 
    
         
            +
                const publicKey = yield getPublicKey();
         
     | 
| 
      
 3930 
     | 
    
         
            +
                const signature = yield signMessage2(message);
         
     | 
| 
      
 3931 
     | 
    
         
            +
                return { signature, publicKey };
         
     | 
| 
       3940 
3932 
     | 
    
         
             
              });
         
     | 
| 
       3941 
3933 
     | 
    
         
             
            }
         
     | 
| 
       3942 
3934 
     | 
    
         
             
            function estimateDepositAmount(amount, option) {
         
     | 
| 
         @@ -5385,7 +5377,7 @@ function getGroup(state) { 
     | 
|
| 
       5385 
5377 
     | 
    
         | 
| 
       5386 
5378 
     | 
    
         
             
            // src/index.ts
         
     | 
| 
       5387 
5379 
     | 
    
         
             
            var getVersion = () => {
         
     | 
| 
       5388 
     | 
    
         
            -
              return "0.5. 
     | 
| 
      
 5380 
     | 
    
         
            +
              return "0.5.99-beta";
         
     | 
| 
       5389 
5381 
     | 
    
         
             
            };
         
     | 
| 
       5390 
5382 
     | 
    
         
             
            if (typeof window !== "undefined") {
         
     | 
| 
       5391 
5383 
     | 
    
         
             
              window.__BTC_WALLET_VERSION = getVersion();
         
     | 
| 
         @@ -5421,6 +5413,7 @@ export { 
     | 
|
| 
       5421 
5413 
     | 
    
         
             
              getBtcUtxos,
         
     | 
| 
       5422 
5414 
     | 
    
         
             
              getCsnaAccountId,
         
     | 
| 
       5423 
5415 
     | 
    
         
             
              getDepositAmount,
         
     | 
| 
      
 5416 
     | 
    
         
            +
              getPublicKeyBase58,
         
     | 
| 
       5424 
5417 
     | 
    
         
             
              getVersion,
         
     | 
| 
       5425 
5418 
     | 
    
         
             
              getWalletConfig,
         
     | 
| 
       5426 
5419 
     | 
    
         
             
              getWithdrawTransaction,
         
     |