### Install Dependencies Source: https://github.com/unisat-wallet/extension/blob/master/README.md Installs all necessary project dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Development Build for Chrome Source: https://github.com/unisat-wallet/extension/blob/master/README.md Starts a development build process for the Chrome browser, enabling faster iteration during development. ```bash yarn build:chrome:dev ``` -------------------------------- ### Get Inscriptions API Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md Retrieves a list of inscriptions associated with the wallet. This method is available from version v1.1.15 onwards. ```APIDOC ## GET /v1.1.15/getInscriptions ### Description Retrieves a list of inscriptions associated with the wallet. This method is available from version v1.1.15 onwards. ### Method GET ### Endpoint /v1.1.15/getInscriptions ### Parameters #### Query Parameters - **offset** (number) - Optional - The number of inscriptions to skip. - **limit** (number) - Optional - The maximum number of inscriptions to return. - **address** (string) - Optional - Filter inscriptions by a specific address. - **inscriptionId** (string) - Optional - Filter inscriptions by a specific inscription ID. ### Response #### Success Response (200) - **inscriptions** (array) - An array of inscription objects. - **inscriptionId** (string) - The ID of the inscription. - **inscriptionNumber** (string) - The number of the inscription. - **address** (string) - The address holding the inscription. - **output** (string) - The transaction output of the inscription. - **outputTxid** (string) - The transaction ID of the inscription output. - **outputVout** (number) - The output index of the inscription. - **content** (string) - The content of the inscription. - **contentType** (string) - The content type of the inscription. ``` -------------------------------- ### Get Inscriptions - JavaScript API Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This JavaScript API method retrieves inscription data. It is useful for users who need to fetch details about their existing inscriptions. The function likely returns an array of inscription objects, each containing relevant metadata. This is a core function for managing and displaying inscriptions within applications. ```javascript unisat.getInscriptions() ``` -------------------------------- ### Build for Firefox Source: https://github.com/unisat-wallet/extension/blob/master/README.md Builds the UniSat Wallet project for the Firefox browser, outputting to the ./dist/ folder. ```bash yarn build:firefox ``` -------------------------------- ### Build for Chrome Source: https://github.com/unisat-wallet/extension/blob/master/README.md Builds the UniSat Wallet project for the Chrome browser, outputting to the ./dist/ folder. ```bash yarn build:chrome ``` -------------------------------- ### Signing P2TR Scripts with TweakedSigner Option Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md Explains how to handle signing P2TR scripts, particularly for CAT20 transactions, by specifying the `useTweakedSigner` option. The default behavior automatically determines the key, but explicit control is provided. ```javascript // For script path inputs, the default behavior is to use the original public key for signing. You can explicitly specify whether to use the TweakedSigner by setting the useTweakedSigner option. If not explicitly set, the signer will automatically determine which key to use based on the presence of a tapLeafScript in the input. If the tapLeafScript contains the original public key, the original key will be used for signing; otherwise, the TweakedSigner will be used. In most cases, the signing method can be automatically determined without needing to pass additional parameters. ``` -------------------------------- ### Sign Multi-Message with UniSat Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md Demonstrates how to use the `unisat.multiSignMessage` method to sign multiple messages, specifying text and signing type. ```javascript unisat.multiSignMessage([{text:'example',type:'ecdsa'}]) ``` -------------------------------- ### Customize Output Value - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This feature allows users to customize the `outputValue` when creating transactions. The `outputValue` determines the amount of BTC to be sent in a transaction. Customization provides flexibility for specific use cases, such as precise fee calculation or batching. ```javascript // Support customization of outputValue ``` -------------------------------- ### Sign PSBT with useTweakedSigner Option Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md Illustrates the use of an optional parameter `useTweakedSigner` in the `signPsbt`/`signPsbts` methods. This parameter enables the use of a tweaked signer for non-Taproot addresses, which is necessary for certain operations like CAT721's lock to mint. ```javascript // Added the optional parameter useTweakedSigner to the methods signPsbt/signPsbts. // This allows for the use of a tweaked signer to sign non-Taproot addresses, which is required for CAT721's lock to mint. ``` -------------------------------- ### Support BIP322 - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This update introduces support for BIP322, a standard for signing messages with Bitcoin keys. This feature enhances the wallet's interoperability and allows users to sign messages that can be verified on the Bitcoin blockchain. Implementation involves integrating the BIP322 signing algorithm. ```javascript // Support BIP322 ``` -------------------------------- ### BRC20 Transfer and Inscribing - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This feature introduces support for BRC-20 token transfers and inscriptions. Users can now manage BRC-20 assets directly within the UniSat wallet. This involves functionality for initiating transfers and creating new BRC-20 inscriptions. ```javascript // Add BRC-20 transfer and inscribing functions ``` -------------------------------- ### Fix Creating Transactions Errors - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This release includes fixes for several errors encountered during the transaction creation process. Ensuring transaction creation is stable and reliable is fundamental for a functional cryptocurrency wallet. ```javascript // Fix some error of creating transactions ``` -------------------------------- ### PSBT Optimization - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This minor change involves optimizing the display of Partially Signed Bitcoin Transactions (PSBTs). Improved display enhances the user experience when reviewing and interacting with PSBTs, making the process clearer and less prone to errors. ```javascript // Optimize the display of PSBT ``` -------------------------------- ### Domain Name Resolution - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This functionality enables domain name resolution for `.unisat` domains. After a domain name is successfully resolved, the corresponding inscription number will be displayed. This feature integrates domain name services directly into the wallet's interface. ```javascript // Add domain name resolution of .unisat ``` ```javascript // After a domain name is resolved successfully, the corresponding inscription number will be displayed ``` -------------------------------- ### Inscribe Transfer API Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md Allows users to inscribe a TRANSFER for BRC-20 tokens. This method is available from version v1.1.17 onwards. ```APIDOC ## POST /v1.1.17/unisat.inscribeTransfer ### Description Allows users to inscribe a TRANSFER for BRC-20 tokens. This method is available from version v1.1.17 onwards. ### Method POST ### Endpoint /v1.1.17/unisat.inscribeTransfer ### Parameters #### Request Body - **ticker** (string) - Required - The ticker symbol of the BRC-20 token. - **amount** (string) - Required - The amount to transfer. ``` -------------------------------- ### Restore Wallet by 24 Words - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This functionality supports restoring a UniSat wallet using a 24-word mnemonic phrase. It's a critical feature for users who need to recover their wallet on a new device or after a data loss. The implementation likely involves validating the mnemonic and reconstructing the wallet's private keys. ```javascript // Support restoring wallet by 24-words ``` -------------------------------- ### Fix PSBT Signing with M44_P2TR Address - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This is a bug fix addressing an issue where signing PSBTs with an M44_P2TR address was failing. Resolving this ensures that users can successfully sign transactions using P2TR addresses, which are important for newer Bitcoin functionalities. ```javascript // Fix a issue that fails to sign PSBT with M44_P2TR address ``` -------------------------------- ### Split UTXO with Multiple Inscriptions - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This feature allows users to split Unspent Transaction Outputs (UTXOs) that contain multiple inscriptions. This provides greater flexibility in managing and consolidating inscriptions. The functionality likely involves selecting a UTXO and specifying how to divide its contents into new UTXOs. ```javascript // Support spliting UTXO that contains multiple inscriptions ``` -------------------------------- ### Send Inscription - JavaScript API Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md The `sendInscription` method is part of the UniSat wallet's JavaScript API, enabling users to send existing inscriptions. This function is essential for transferring ownership of an inscription to another address. It likely requires parameters such as the inscription ID and the recipient's address. ```javascript unisat.sendInscription() ``` -------------------------------- ### Sign Multiple PSBTs - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This feature enables users to sign multiple Partially Signed Bitcoin Transactions (PSBTs) simultaneously. This is a significant enhancement for workflows involving multiple transactions, improving efficiency and user experience. The process likely involves presenting all PSBTs for review and signing. ```javascript // Sign multiple PSBT in one time ``` -------------------------------- ### Choose P2TR Address Type When Restoring from Xverse Wallet - JavaScript Feature Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This feature allows users to choose the P2TR address type when restoring their wallet from Xverse. This enhances compatibility and flexibility for users migrating between different wallet software that supports P2TR addresses. ```javascript // Can choose P2TR address type when restoring from Xverse Wallet ``` -------------------------------- ### Fix Display Issue of "Failed to fetch." - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix resolves a display issue where the message "Failed to fetch." was shown incorrectly. Ensuring that error messages are accurate and displayed appropriately is crucial for user feedback and debugging. ```javascript // Fix a display issue of "Failed to fetch." ``` -------------------------------- ### Fix N/A Problem Due to Illegal Input Amount - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix addresses an 'N/A' problem that occurred because the input amount was not legal. This implies validation issues with user input for transaction amounts, leading to errors. The fix ensures proper input validation for transaction amounts. ```javascript // Fix a issue that N/A problem occurs because the input amount is not legal ``` -------------------------------- ### Fix Addresses with Many UTXOs Cannot Construct Transactions - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix addresses an issue where addresses holding a large number of UTXOs were unable to construct transactions. This problem likely stemmed from limitations in UTXO selection or transaction building logic, impacting users with significant on-chain activity. ```javascript // Fix a issue that addresses holding too many UTXOs cannot construct transactions ``` -------------------------------- ### Fix Issue Selecting Account Not Taking Effect - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix addresses an issue where selecting an account in the wallet did not take effect. This prevented users from switching to and using the intended account, impacting usability and transaction routing. ```javascript // Fix a issue that selecting an account do not take effect ``` -------------------------------- ### Inscribe BRC20 Transfer - JavaScript API Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This JavaScript API function allows users to inscribe a BRC20 transfer. It requires the ticker symbol and the amount to be transferred as string inputs. This function is part of the UniSat wallet's developer API for interacting with the Bitcoin blockchain and BRC20 tokens. ```javascript unisat.inscribeTransfer(ticker:string, amount:string) ``` -------------------------------- ### Fix Changing Wallet/Account Name Not Taking Effect - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix resolves an issue where changing a wallet or account name sometimes did not take effect. Ensuring that name changes are persistently applied is important for user organization and preference management within the wallet. ```javascript // Fix a issue that changing wallet/account name sometimes does not take effect ``` -------------------------------- ### Export Hex Private Key - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This functionality enables users to export their private key in hexadecimal format. This is an advanced feature primarily for backup or migration purposes. Due to security implications, exporting private keys typically involves clear warnings and user confirmation. ```javascript // Support exporting Hex Private Key ``` -------------------------------- ### Send Inscription API Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md Sends an inscription from one address to another. This method is available from version v1.1.15 onwards. ```APIDOC ## POST /v1.1.15/sendInscription ### Description Sends an inscription from one address to another. This method is available from version v1.1.15 onwards. ### Method POST ### Endpoint /v1.1.15/sendInscription ### Parameters #### Request Body - **inscriptionId** (string) - Required - The ID of the inscription to send. - **toAddress** (string) - Required - The recipient's address. - **feeRate** (number) - Optional - The fee rate in satoshis per virtual byte. ### Response #### Success Response (200) - **txid** (string) - The transaction ID of the sent inscription. ``` -------------------------------- ### Disable .btc Domain - JavaScript Change Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This change involves disabling the `.btc` domain feature within the UniSat wallet. This might be due to deprecation, development priorities, or technical reasons. Users relying on this feature will need to find alternative solutions. ```javascript // Remove .btc domain ``` -------------------------------- ### Fix Wallet Name Issue After Deleting Wallet - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix addresses an issue where all wallet names became incorrect after deleting a wallet. Ensuring correct wallet naming and management is crucial for user experience and organization within the wallet interface. ```javascript // Fix the issue that all wallet's names become wrong after deleting a wallet ``` -------------------------------- ### Fix getBalance API Incorrect Unconfirmed Balance - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix addresses an issue where the `getBalance` API was returning an incorrect value for the unconfirmed balance. Ensuring accurate balance reporting is critical for user confidence and proper transaction management within applications using the API. ```javascript // Fix a issue that "getBalance " API returns incorrect unconfirmed balance ``` -------------------------------- ### Fix Pagination Display Error - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix resolves a display error related to pagination within the UniSat wallet. Proper pagination is essential for navigating through lists of items, such as transactions or inscriptions, ensuring a smooth user experience. ```javascript // Fix display error of pagination ``` -------------------------------- ### Fix Error with BRC-20 Special Characters - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This minor change fixes an error specifically related to handling BRC-20 tokens that contain special characters. This ensures that BRC-20 functionalities remain robust even when dealing with non-standard characters in token names or data. ```javascript // Fix error of BRC-20 with special characters ``` -------------------------------- ### Modify Account Name - JavaScript Functionality Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This functionality allows users to modify the names of their accounts within the UniSat wallet. Renaming accounts can help users better organize and identify different wallets or sets of keys. The feature requires an interface to input the new name and apply the change. ```javascript // Add support for modifying account name ``` -------------------------------- ### Fix Incorrect Secret Recovery Phrase Export - JavaScript Fix Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This bug fix resolves an issue where exporting a non-active wallet incorrectly exported the Secret Recovery Phrase of the active wallet. This ensures that users receive the correct recovery phrase for the intended wallet, preventing potential security risks and recovery failures. ```javascript // Fix a issue that when exporting a non-active wallet, incorrectly exports the Secret Recovery Phrase of the active wallet ``` -------------------------------- ### Hide Inscription Number When Unconfirmed - JavaScript Feature Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This feature hides the inscription number for unconfirmed inscriptions. This provides a cleaner UI by not displaying potentially transient or incomplete information until the inscription is fully confirmed on the blockchain. ```javascript // Hide Inscription Number when unconfirmed ``` -------------------------------- ### Disable Iframes - JavaScript Change Source: https://github.com/unisat-wallet/extension/blob/master/release-notes.md This change disables the use of iframes within the UniSat wallet. Disabling iframes can be a security measure to prevent potential cross-site scripting (XSS) vulnerabilities or other risks associated with embedded content. This affects how certain external content might be displayed. ```javascript // Disable in iframes ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.