{"_id":"@blooo/hw-app-acre","_rev":"2-1e8843d04e6ffa9b2eb40d18a387326a","name":"@blooo/hw-app-acre","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.1":{"name":"@blooo/hw-app-acre","version":"1.0.1","keywords":["Ledger","LedgerWallet","btc","Bitcoin","Acre","NanoS","Blue","Hardware Wallet"],"license":"Apache-2.0","_id":"@blooo/hw-app-acre@1.0.1","maintainers":[{"name":"n4l5u0r","email":"rouslan@blooo.io"}],"homepage":"https://github.com/blooo-io/hw-app-acre","bugs":{"url":"https://github.com/blooo-io/hw-app-acre/issues"},"dist":{"shasum":"01b4207a11ff7dd719f856d3ec0e2a47caae1a68","tarball":"https://registry.npmjs.org/@blooo/hw-app-acre/-/hw-app-acre-1.0.1.tgz","fileCount":196,"integrity":"sha512-lLwG2abLFks6B8rHatIfj8rOSajzjCQlT6Wa4zoZnlxWqv8o3oIZ/kQzO3Mf3CgY2i3kMk3DqNKd7yBtXyfnEg==","signatures":[{"sig":"MEQCIEMLRpPx6ZXNcVeCNbcrapeE9EfNmCTzy8lOJxD9kMDiAiACkFvZ0cHCPkIegO9u33lk5enyd9RXYOT15JUuVwyLwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":708612},"main":"lib/Acre.js","types":"lib/Acre.d.ts","module":"lib-es/Acre.js","exports":{".":{"default":"./lib-es/Acre.js","require":"./lib/Acre.js"},"./*":{"default":"./lib-es/*.js","require":"./lib/*.js"},"./*.js":{"default":"./lib-es/*.js","require":"./lib/*.js"},"./lib/*":"./lib/*.js","./lib-es/*":"./lib-es/*.js","./lib/*.js":"./lib/*.js","./lib-es/*.js":"./lib-es/*.js","./package.json":"./package.json"},"gitHead":"dd0dea64b58e5a9125c8a422dcffd29e5ef6abec","scripts":{"doc":"documentation readme src/** --section=API --pe ts --re ts --re d.ts","lint":"eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache","test":"jest","build":"tsc && tsc -m ES6 --outDir lib-es","clean":"rimraf lib lib-es","watch":"tsc --watch","lint:fix":"pnpm lint --fix","prewatch":"pnpm build","unimported":"unimported"},"_npmUser":{"name":"n4l5u0r","email":"rouslan@blooo.io"},"repository":{"url":"git+https://github.com/blooo-io/hw-app-acre.git","type":"git"},"_npmVersion":"8.19.4","description":"Ledger Hardware Wallet Acre Application API","directories":{},"_nodeVersion":"16.20.2","dependencies":{"bs58":"^4.0.1","semver":"^7.3.5","sha.js":"2","bs58check":"^2.1.2","invariant":"^2.2.4","ripemd160":"2","bip32-path":"^0.4.2","typescript":"^5.5.4","bitcoinjs-lib":"^5.2.0","@ledgerhq/logs":"6.12.0","tiny-secp256k1":"1.1.6","varuint-bitcoin":"1.1.2","@ledgerhq/hw-transport":"6.31.3"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"*":["lib/*","lib/Acre.d.ts"],"lib/*":["lib/*"],"lib-es/*":["lib-es/*"]}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","axios":"^0.25.0","rimraf":"^4.4.1","ts-jest":"^29.1.1","ts-node":"^10.4.0","@types/jest":"^29.5.10","@types/node":"^20.8.10","documentation":"14.0.2","source-map-support":"^0.5.21","@ledgerhq/hw-transport-mocker":"6.29.3","@ledgerhq/hw-transport-node-speculos":"6.29.3"},"_npmOperationalInternal":{"tmp":"tmp/hw-app-acre_1.0.1_1727272708350_0.7773303585057005","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@blooo/hw-app-acre","version":"1.1.0","keywords":["Ledger","LedgerWallet","btc","Bitcoin","Acre","NanoS","Blue","Hardware Wallet"],"license":"Apache-2.0","_id":"@blooo/hw-app-acre@1.1.0","maintainers":[{"name":"n4l5u0r","email":"rouslan@blooo.io"}],"homepage":"https://github.com/blooo-io/hw-app-acre","bugs":{"url":"https://github.com/blooo-io/hw-app-acre/issues"},"dist":{"shasum":"b8d5591bccaa74d936bb8892855a6f7cd737ff9f","tarball":"https://registry.npmjs.org/@blooo/hw-app-acre/-/hw-app-acre-1.1.0.tgz","fileCount":196,"integrity":"sha512-rD/z0eaLEv6lLZCu4JFaWySIfc8zRfn0hE8HoUEm8F9qPgfk0dose7W1ZA/uqjDL4XTpk0LjSGBD8YEwwaMrIg==","signatures":[{"sig":"MEUCIA8k/TiDd32z2wpYjOkYe9VaU7oxgSFBSAi5ev4k+UrNAiEA2TdpOQcorlaSr63ny96Ug2iyMAhjNyc9ahym7BojXcA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":719314},"main":"lib/Acre.js","types":"lib/Acre.d.ts","module":"lib-es/Acre.js","exports":{".":{"default":"./lib-es/Acre.js","require":"./lib/Acre.js"},"./*":{"default":"./lib-es/*.js","require":"./lib/*.js"},"./*.js":{"default":"./lib-es/*.js","require":"./lib/*.js"},"./lib/*":"./lib/*.js","./lib-es/*":"./lib-es/*.js","./lib/*.js":"./lib/*.js","./lib-es/*.js":"./lib-es/*.js","./package.json":"./package.json"},"gitHead":"dd0dea64b58e5a9125c8a422dcffd29e5ef6abec","scripts":{"doc":"documentation readme src/** --section=API --pe ts --re ts --re d.ts","lint":"eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache","test":"jest","build":"tsc && tsc -m ES6 --outDir lib-es","clean":"rimraf lib lib-es","watch":"tsc --watch","lint:fix":"pnpm lint --fix","prewatch":"pnpm build","unimported":"unimported"},"_npmUser":{"name":"n4l5u0r","email":"rouslan@blooo.io"},"repository":{"url":"git+https://github.com/blooo-io/hw-app-acre.git","type":"git"},"_npmVersion":"8.19.4","description":"Ledger Hardware Wallet Acre Application API","directories":{},"_nodeVersion":"16.20.2","dependencies":{"bs58":"^4.0.1","semver":"^7.3.5","sha.js":"2","bs58check":"^2.1.2","invariant":"^2.2.4","ripemd160":"2","bip32-path":"^0.4.2","typescript":"^5.5.4","bitcoinjs-lib":"^5.2.0","@ledgerhq/logs":"6.12.0","tiny-secp256k1":"1.1.6","varuint-bitcoin":"1.1.2","@ledgerhq/hw-transport":"6.31.3"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"*":["lib/*","lib/Acre.d.ts"],"lib/*":["lib/*"],"lib-es/*":["lib-es/*"]}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","axios":"^0.25.0","rimraf":"^4.4.1","ts-jest":"^29.1.1","ts-node":"^10.4.0","@types/jest":"^29.5.10","@types/node":"^20.8.10","documentation":"14.0.2","source-map-support":"^0.5.21","@ledgerhq/hw-transport-mocker":"6.29.3","@ledgerhq/hw-transport-node-speculos":"6.29.3"},"_npmOperationalInternal":{"tmp":"tmp/hw-app-acre_1.1.0_1729669839756_0.20936969037854847","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@blooo/hw-app-acre","version":"1.1.1","description":"Ledger Hardware Wallet Acre Application API","keywords":["Ledger","LedgerWallet","btc","Bitcoin","Acre","NanoS","Blue","Hardware Wallet"],"repository":{"type":"git","url":"git+https://github.com/blooo-io/hw-app-acre.git"},"bugs":{"url":"https://github.com/blooo-io/hw-app-acre/issues"},"homepage":"https://github.com/blooo-io/hw-app-acre","publishConfig":{"access":"public"},"main":"lib/Acre.js","module":"lib-es/Acre.js","types":"lib/Acre.d.ts","typesVersions":{"*":{"lib/*":["lib/*"],"lib-es/*":["lib-es/*"],"*":["lib/*","lib/Acre.d.ts"]}},"exports":{"./lib/*":"./lib/*.js","./lib/*.js":"./lib/*.js","./lib-es/*":"./lib-es/*.js","./lib-es/*.js":"./lib-es/*.js","./*":{"require":"./lib/*.js","default":"./lib-es/*.js"},"./*.js":{"require":"./lib/*.js","default":"./lib-es/*.js"},".":{"require":"./lib/Acre.js","default":"./lib-es/Acre.js"},"./package.json":"./package.json"},"license":"Apache-2.0","dependencies":{"@ledgerhq/hw-transport":"6.31.3","@ledgerhq/logs":"6.12.0","bip32-path":"^0.4.2","bitcoinjs-lib":"^5.2.0","bs58":"^4.0.1","bs58check":"^2.1.2","invariant":"^2.2.4","ripemd160":"2","semver":"^7.3.5","sha.js":"2","tiny-secp256k1":"1.1.6","typescript":"^5.5.4","varuint-bitcoin":"1.1.2"},"devDependencies":{"@ledgerhq/hw-transport-mocker":"6.29.3","@ledgerhq/hw-transport-node-speculos":"6.29.3","@types/jest":"^29.5.10","@types/node":"^20.8.10","axios":"^0.25.0","documentation":"14.0.2","jest":"^29.7.0","rimraf":"^4.4.1","source-map-support":"^0.5.21","ts-jest":"^29.1.1","ts-node":"^10.4.0"},"scripts":{"clean":"rimraf lib lib-es","build":"tsc && tsc -m ES6 --outDir lib-es","prewatch":"pnpm build","watch":"tsc --watch","doc":"documentation readme src/** --section=API --pe ts --re ts --re d.ts","lint":"eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache","lint:fix":"pnpm lint --fix","test":"jest","unimported":"unimported"},"gitHead":"dd0dea64b58e5a9125c8a422dcffd29e5ef6abec","_id":"@blooo/hw-app-acre@1.1.1","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-wWYUGR0sj4Yyy3GtiFRpRuaBdIgzbg8BnXCfUeduUzjQaMWzQ66wSvaJn4pHrIAdGwmdyqJWn3UqFgb1YPq0VQ==","shasum":"fe9a93f8a45876974f3111189e1a5bdba4c99228","tarball":"https://registry.npmjs.org/@blooo/hw-app-acre/-/hw-app-acre-1.1.1.tgz","fileCount":196,"unpackedSize":723276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGXFqQrOw+uUfzPN0/l/fxBhWnb/0EiI47XWm2lW1J7wIgB+Gcy52oJUf41C9D+liuXcGAazWVm+8mX7L9TMhHqhE="}]},"_npmUser":{"name":"n4l5u0r","email":"rouslan@blooo.io"},"directories":{},"maintainers":[{"name":"n4l5u0r","email":"rouslan@blooo.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hw-app-acre_1.1.1_1729869156600_0.22950127168623857"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-25T13:58:28.252Z","modified":"2024-10-25T15:12:37.203Z","1.0.1":"2024-09-25T13:58:28.612Z","1.1.0":"2024-10-23T07:50:40.013Z","1.1.1":"2024-10-25T15:12:36.976Z"},"bugs":{"url":"https://github.com/blooo-io/hw-app-acre/issues"},"license":"Apache-2.0","homepage":"https://github.com/blooo-io/hw-app-acre","keywords":["Ledger","LedgerWallet","btc","Bitcoin","Acre","NanoS","Blue","Hardware Wallet"],"repository":{"type":"git","url":"git+https://github.com/blooo-io/hw-app-acre.git"},"description":"Ledger Hardware Wallet Acre Application API","maintainers":[{"name":"n4l5u0r","email":"rouslan@blooo.io"}],"readme":"<img src=\"https://user-images.githubusercontent.com/4631227/191834116-59cf590e-25cc-4956-ae5c-812ea464f324.png\" height=\"100\" />\n\n[GitHub](https://github.com/LedgerHQ/ledger-live/),\n[Ledger Devs Discord](https://developers.ledger.com/discord-pro),\n[Developer Portal](https://developers.ledger.com/)\n\n## @blooo/hw-app-acre\n\nLedger Hardware Wallet Acre JavaScript bindings. Also supports many altcoins.\n\n***\n\n## Are you adding Ledger support to your software wallet?\n\nYou may be using this package to communicate with the Acre Nano App.\n\nFor a smooth and quick integration:\n\n*   See the developers’ documentation on the [Developer Portal](https://developers.ledger.com/docs/transport/overview/) and\n*   Go on [Discord](https://developers.ledger.com/discord-pro/) to chat with developer support and the developer community.\n\n***\n\n## API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n#### Table of Contents\n\n*   [bippath](#bippath)\n*   [Acre](#acre)\n    *   [Parameters](#parameters)\n    *   [Examples](#examples)\n    *   [getWalletXpub](#getwalletxpub)\n        *   [Parameters](#parameters-1)\n    *   [getWalletPublicKey](#getwalletpublickey)\n        *   [Parameters](#parameters-2)\n        *   [Examples](#examples-1)\n    *   [signMessage](#signmessage)\n        *   [Parameters](#parameters-3)\n        *   [Examples](#examples-2)\n    *   [createPaymentTransaction](#createpaymenttransaction)\n        *   [Parameters](#parameters-4)\n        *   [Examples](#examples-3)\n    *   [signP2SHTransaction](#signp2shtransaction)\n        *   [Parameters](#parameters-5)\n        *   [Examples](#examples-4)\n    *   [splitTransaction](#splittransaction)\n        *   [Parameters](#parameters-6)\n        *   [Examples](#examples-5)\n    *   [serializeTransactionOutputs](#serializetransactionoutputs)\n        *   [Parameters](#parameters-7)\n        *   [Examples](#examples-6)\n    *   [getTrustedInput](#gettrustedinput)\n        *   [Parameters](#parameters-8)\n    *   [getTrustedInputBIP143](#gettrustedinputbip143)\n        *   [Parameters](#parameters-9)\n    *   [signWithdrawal](#signwithdrawal)\n        *   [Parameters](#parameters-10)\n        *   [Examples](#examples-7)\n    *   [signERC4361Message](#signerc4361message)\n        *   [Parameters](#parameters-11)\n        *   [Examples](#examples-8)\n*   [AcreBtcNew](#acrebtcnew)\n    *   [getWalletXpub](#getwalletxpub-1)\n        *   [Parameters](#parameters-12)\n    *   [getWalletPublicKey](#getwalletpublickey-1)\n        *   [Parameters](#parameters-13)\n    *   [createPaymentTransaction](#createpaymenttransaction-1)\n        *   [Parameters](#parameters-14)\n    *   [signMessage](#signmessage-1)\n        *   [Parameters](#parameters-15)\n    *   [signWithdrawal](#signwithdrawal-1)\n        *   [Parameters](#parameters-16)\n    *   [signERC4361Message](#signerc4361message-1)\n        *   [Parameters](#parameters-17)\n*   [descrTemplFrom](#descrtemplfrom)\n    *   [Parameters](#parameters-18)\n*   [AcreBtcOld](#acrebtcold)\n    *   [getWalletPublicKey](#getwalletpublickey-2)\n        *   [Parameters](#parameters-19)\n        *   [Examples](#examples-9)\n    *   [createPaymentTransaction](#createpaymenttransaction-2)\n        *   [Parameters](#parameters-20)\n        *   [Examples](#examples-10)\n*   [CreateTransactionArg](#createtransactionarg)\n    *   [Properties](#properties)\n*   [AddressFormat](#addressformat)\n*   [AcreWithdrawalData](#acrewithdrawaldata)\n    *   [Properties](#properties-1)\n*   [AccountType](#accounttype)\n    *   [spendingCondition](#spendingcondition)\n        *   [Parameters](#parameters-21)\n    *   [setInput](#setinput)\n        *   [Parameters](#parameters-22)\n    *   [setOwnOutput](#setownoutput)\n        *   [Parameters](#parameters-23)\n    *   [getDescriptorTemplate](#getdescriptortemplate)\n*   [SingleKeyAccount](#singlekeyaccount)\n*   [getTaprootOutputKey](#gettaprootoutputkey)\n    *   [Parameters](#parameters-24)\n*   [AppClient](#appclient)\n    *   [Parameters](#parameters-25)\n*   [ClientCommandInterpreter](#clientcommandinterpreter)\n    *   [Parameters](#parameters-26)\n*   [MerkelizedPsbt](#merkelizedpsbt)\n    *   [Parameters](#parameters-27)\n*   [Merkle](#merkle)\n    *   [Parameters](#parameters-28)\n*   [MerkleMap](#merklemap)\n    *   [Parameters](#parameters-29)\n*   [WalletPolicy](#walletpolicy)\n    *   [Parameters](#parameters-30)\n*   [extract](#extract)\n    *   [Parameters](#parameters-31)\n*   [finalize](#finalize)\n    *   [Parameters](#parameters-32)\n*   [clearFinalizedInput](#clearfinalizedinput)\n    *   [Parameters](#parameters-33)\n*   [writePush](#writepush)\n    *   [Parameters](#parameters-34)\n*   [PsbtV2](#psbtv2)\n*   [serializeTransactionOutputs](#serializetransactionoutputs-1)\n    *   [Parameters](#parameters-35)\n    *   [Examples](#examples-11)\n*   [SignP2SHTransactionArg](#signp2shtransactionarg)\n    *   [Properties](#properties-2)\n*   [TransactionInput](#transactioninput)\n*   [TransactionOutput](#transactionoutput)\n*   [Transaction](#transaction)\n\n### bippath\n\nBIP32 Path Handling for Bitcoin Wallets\n\nThis file provides utility functions to handle BIP32 paths,\nwhich are commonly used in hierarchical deterministic (HD) wallets.\nIt includes functions to convert BIP32 paths to and from different formats,\nextract components from extended public keys (xpubs), and manipulate path elements.\n\n### Acre\n\nAcre app API.\n\n#### Parameters\n\n*   `transport`  The transport layer used for communication.\n*   `scrambleKey`  This parameter is deprecated and no longer needed.\n*   `currency`  The currency to use, defaults to \"bitcoin\".\n\n#### Examples\n\n```javascript\nimport Acre from \"@blooo/hw-app-acre:\";\nconst acre = new Acre({ transport, currency: \"bitcoin\" });\n```\n\n#### getWalletXpub\n\nGet an XPUB with a ledger device\n\n##### Parameters\n\n*   `arg` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), xpubVersion: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}** derivation parameter*   path: a BIP 32 path of the account level. (e.g. The derivation path `84'/0'/0'`\n        follows the `purpose' / coin_type' / account'` standard, with purpose=84, coin\\_type=0, account=0)\n    *   xpubVersion: the XPUBVersion of the coin used. (refer to ledgerjs/packages/cryptoassets/src/currencies.ts\n        for the XPUBVersion value if needed)\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** XPUB of the account\n\n#### getWalletPublicKey\n\n##### Parameters\n\n*   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a BIP 32 path (i.e. the `purpose’ / coin_type’ / account’ / change / address_index` standard)\n*   `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}?**&#x20;\n*   `options`  an object with optional these fields:*   verify (boolean) whether ask user to confirm the address on the device\n\n    *   format (\"legacy\" | \"p2sh\" | \"bech32\" | \"bech32m\" | \"cashaddr\") to use different bitcoin address formatter.NB The normal usage is to use:*   legacy format with 44' paths\n\n    *   p2sh format with 49' paths\n\n    *   bech32 format with 84' paths\n\n    *   bech32m format with 86' paths\n\n    *   cashaddr in case of Bitcoin Cash\n\n##### Examples\n\n```javascript\nacre.getWalletPublicKey(\"44'/0'/0'/0/0\").then(o => o.bitcoinAddress)\nacre.getWalletPublicKey(\"49'/0'/0'/0/0\", { format: \"p2sh\" }).then(o => o.bitcoinAddress)\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n#### signMessage\n\nYou can sign a message according to the Bitcoin Signature format and retrieve v, r, s given the message and the BIP 32 path of the account to sign.\n\n##### Parameters\n\n*   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n*   `messageHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n\n##### Examples\n\n```javascript\nacre.signMessage(\"44'/60'/0'/0'/0\", Buffer.from(\"test\").toString(\"hex\")).then(function(result) {\nvar v = result['v'] + 27 + 4;\nvar signature = Buffer.from(v.toString(16) + result['r'] + result['s'], 'hex').toString('base64');\nconsole.log(\"Signature : \" + signature);\n}).catch(function(ex) {console.log(ex);});\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n#### createPaymentTransaction\n\nTo sign a transaction involving standard (P2PKH) inputs, call createTransaction with the following parameters\n\n##### Parameters\n\n*   `arg` **[CreateTransactionArg](#createtransactionarg)**&#x20;\n*   `inputs`  is an array of \\[ transaction, output\\_index, optional redeem script, optional sequence ] where*   transaction is the previously computed transaction object for this UTXO\n    *   output\\_index is the output in the transaction used as input for this UTXO (counting from 0)\n    *   redeem script is the optional redeem script to use when consuming a Segregated Witness input\n    *   sequence is the sequence number to use for this input (when using RBF), or non present\n*   `associatedKeysets`  is an array of BIP 32 paths pointing to the path to the private key used for each UTXO\n*   `changePath`  is an optional BIP 32 path pointing to the path to the public key used to compute the change address\n*   `outputScriptHex`  is the hexadecimal serialized outputs of the transaction to sign, including leading vararg voutCount\n*   `lockTime`  is the optional lockTime of the transaction to sign, or default (0)\n*   `sigHashType`  is the hash type of the transaction to sign, or default (all)\n*   `segwit`  is an optional boolean indicating wether to use segwit or not. This includes wrapped segwit.\n*   `additionals`  list of additionnal options*   \"bech32\" for spending native segwit outputs\n    *   \"bech32m\" for spending segwit v1+ outputs\n    *   \"abc\" for bch\n    *   \"gold\" for btg\n    *   \"decred\" for decred\n    *   \"zcash\" for zcash\n    *   \"bipxxx\" for using BIPxxx\n    *   \"sapling\" to indicate a zec transaction is supporting sapling (to be set over block 419200)\n*   `expiryHeight`  is an optional Buffer for zec overwinter / sapling Txs\n*   `useTrustedInputForSegwit`  trust inputs for segwit transactions. If app version >= 1.4.0 this should be true.\n\n##### Examples\n\n```javascript\nacre.createTransaction({\ninputs: [ [tx1, 1] ],\nassociatedKeysets: [\"0'/0/0\"],\noutputScriptHex: \"01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac\"\n}).then(res => ...);\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** the signed transaction ready to be broadcast\n\n#### signP2SHTransaction\n\nTo obtain the signature of multisignature (P2SH) inputs, call signP2SHTransaction\\_async with the folowing parameters\n\n##### Parameters\n\n*   `arg` **[SignP2SHTransactionArg](#signp2shtransactionarg)**&#x20;\n*   `inputs`  is an array of \\[ transaction, output\\_index, redeem script, optional sequence ] where*   transaction is the previously computed transaction object for this UTXO\n    *   output\\_index is the output in the transaction used as input for this UTXO (counting from 0)\n    *   redeem script is the mandatory redeem script associated to the current P2SH input\n    *   sequence is the sequence number to use for this input (when using RBF), or non present\n*   `associatedKeysets`  is an array of BIP 32 paths pointing to the path to the private key used for each UTXO\n*   `outputScriptHex`  is the hexadecimal serialized outputs of the transaction to sign\n*   `lockTime`  is the optional lockTime of the transaction to sign, or default (0)\n*   `sigHashType`  is the hash type of the transaction to sign, or default (all)\n\n##### Examples\n\n```javascript\nacre.signP2SHTransaction({\ninputs: [ [tx, 1, \"52210289b4a3ad52a919abd2bdd6920d8a6879b1e788c38aa76f0440a6f32a9f1996d02103a3393b1439d1693b063482c04bd40142db97bdf139eedd1b51ffb7070a37eac321030b9a409a1e476b0d5d17b804fcdb81cf30f9b99c6f3ae1178206e08bc500639853ae\"] ],\nassociatedKeysets: [\"0'/0/0\"],\noutputScriptHex: \"01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac\"\n}).then(result => ...);\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>>** the signed transaction ready to be broadcast\n\n#### splitTransaction\n\nFor each UTXO included in your transaction, create a transaction object from the raw serialized version of the transaction used in this UTXO.\n\n##### Parameters\n\n*   `transactionHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a raw hexadecimal serialized transaction\n*   `isSegwitSupported` **([boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** is a boolean indicating if the segwit is supported (optional, default `false`)\n*   `hasExtraData`  is a boolean (komodo, zencash and zcash include extraData in their transactions, others don't) (optional, default `false`)\n*   `additionals` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** list of additionnal options (optional, default `[]`)\n\n##### Examples\n\n```javascript\nconst tx1 = acre.splitTransaction(\"01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000\");\n```\n\nReturns **[Transaction](#transaction)** the transaction object deserialized from the raw hexadecimal transaction\n\n#### serializeTransactionOutputs\n\nSerialize a transaction's outputs to hexadecimal\n\n##### Parameters\n\n*   `t` **[Transaction](#transaction)**&#x20;\n\n##### Examples\n\n```javascript\nconst tx1 = acre.splitTransaction(\"01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000\");\nconst outputScript = acre.serializeTransactionOutputs(tx1).toString('hex');\n```\n\nReturns **[Buffer](https://nodejs.org/api/buffer.html)**&#x20;\n\n#### getTrustedInput\n\nTrusted input is the hash of a UTXO that needs to be signed\nFor Legacy transactions, the app has some APDUs flows that do the amount check for an UTXO,\nby parsing the transaction that created this UTXO\n\n##### Parameters\n\n*   `indexLookup` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;\n*   `transaction` **[Transaction](#transaction)**&#x20;\n*   `additionals` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**  (optional, default `[]`)\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;\n\n#### getTrustedInputBIP143\n\nTrusted input is the hash of a UTXO that needs to be signed. BIP143 is used for Segwit inputs.\n\n##### Parameters\n\n*   `indexLookup` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;\n*   `transaction` **[Transaction](#transaction)**&#x20;\n*   `additionals` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**  (optional, default `[]`)\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n\n#### signWithdrawal\n\nSigns an Acre Withdrawal message with the private key at\nthe provided derivation path according to the Bitcoin Signature format\nand returns v, r, s.\n\n##### Parameters\n\n*   `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), withdrawalData: [AcreWithdrawalData](#acrewithdrawaldata)}**\n\n    *   `$0.path` &#x20;\n    *   `$0.withdrawalData` &#x20;\n\n##### Examples\n\n```javascript\n      var withdrawalData = {\n        to: \"0xc14972DC5a4443E4f5e89E3655BE48Ee95A795aB\",\n        value: \"0x0\",\n        data: \"0xcae9ca510000000000000000000000000e781e9d538895ee99bd6e9bf28664942beff32f00000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000006083Bde64CCBF08470a1a0dAa9a0281B4951be7C4b5e4623765ec95cfa6e261406d5c446012eff9300000000000000000000000008dcc842b8ed75efe1f222ebdc22d1b06ef35efff6469f708057266816f0595200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000587f579c500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001a1976a914c8e9edf5e915c0482b1b236fc917011a4b943e6e88ac000000000000\",\n        operation: \"0\",\n        safeTxGas: \"0x0\",\n        baseGas: \"0x0\",\n        gasPrice: \"0x0\",\n        gasToken: \"0x0000000000000000000000000000000000000000\",\n        refundReceiver: \"0x0000000000000000000000000000000000000000\",\n        nonce: \"0xC\",\n      };\n      acre.signWithdrawal({\"m/44'/0'/0'/0/0\", withdrawalData}).then(function(result) {\n        var v = result['v'] + 27 + 4;\n        var signature = Buffer.from(v.toString(16) + result['r'] + result['s'], 'hex').toString('base64');\n        console.log(\"Signature : \" + signature);\n        }).catch(function(ex) {console.log(ex);});\n```\n\n#### signERC4361Message\n\nSigns an Ethereum Sign-In (ERC-4361) message with the private key at\nthe provided derivation path according to the Bitcoin Signature format\nand returns v, r, s.\n\n##### Parameters\n\n*   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n*   `messageHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n\n##### Examples\n\n```javascript\nacre.signERC4361Message(\"44'/60'/0'/0'/0\", Buffer.from(\"Example ERC-4361 message\").toString(\"hex\")).then(function(result) {\n  const v = result['v'] + 27 + 4;\n  const signature = Buffer.from(v.toString(16) + result['r'] + result['s'], 'hex').toString('base64');\n  console.log(\"Signature : \" + signature);\n}).catch(function(ex) {console.log(ex);});\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n**Note:** The message is restricted to maximum 128 character lines.\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n\n### AcreBtcNew\n\nThis class implements the same interface as AcreBtcOld (formerly\nnamed Btc), but interacts with Acre hardware app from version 1.0.0\nwhich uses the same APDU protocol as the Bitcoin app version 2.1.0+.\nThis protocol is documented at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md>\n\nSince the interface must remain compatible with AcreBtcOld, the methods\nof this class are quite clunky, because it needs to adapt legacy\ninput data into the PSBT process.\n\n#### getWalletXpub\n\nThis is a new method that allow users to get an xpub at a standard path.\nStandard paths are described at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md#description>\n\nThis boils down to paths (N=0 for Bitcoin, N=1 for Testnet):\nM/44'/N'/x'/\\*\\*\nM/48'/N'/x'/y'/\\*\\*\nM/49'/N'/x'/\\*\\*\nM/84'/N'/x'/\\*\\*\nM/86'/N'/x'/\\*\\*\n\nThe method was added because of added security in the hardware app v2+. The\nnew hardware app will allow export of any xpub up to and including the\ndeepest hardened key of standard derivation paths, whereas the old app\nwould allow export of any key.\n\nThis caused an issue for callers of this class, who only had\ngetWalletPublicKey() to call which means they have to constuct xpub\nthemselves:\n\nSuppose a user of this class wants to create an account xpub on a standard\npath, M/44'/0'/Z'. The user must get the parent key fingerprint (see BIP32)\nby requesting the parent key M/44'/0'. The new app won't allow that, because\nit only allows exporting deepest level hardened path. So the options are to\nallow requesting M/44'/0' from the app, or to add a new function\n\"getWalletXpub\".\n\nWe opted for adding a new function, which can greatly simplify client code.\n\n##### Parameters\n\n*   `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), xpubVersion: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}**&#x20;\n\n    *   `$0.path` &#x20;\n    *   `$0.xpubVersion` &#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;\n\n#### getWalletPublicKey\n\nThis method returns a public key, a bitcoin address, and and a chaincode\nfor a specific derivation path.\n\nLimitation: If the path is not a leaf node of a standard path, the address\nwill be the empty string \"\", see this.getWalletAddress() for details.\n\n##### Parameters\n\n*   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n*   `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}?**&#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n#### createPaymentTransaction\n\nBuild and sign a transaction. See Acre.createPaymentTransaction for\ndetails on how to use this method.\n\nThis method will convert the legacy arguments, CreateTransactionArg, into\na psbt which is finally signed and finalized, and the extracted fully signed\ntransaction is returned.\n\n##### Parameters\n\n*   `arg` **[CreateTransactionArg](#createtransactionarg)**&#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;\n\n#### signMessage\n\nSigns an arbitrary hex-formatted message with the private key at\nthe provided derivation path according to the Bitcoin Signature format\nand returns v, r, s.\n\n##### Parameters\n\n*   `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), withdrawalData: [AcreWithdrawalData](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}**&#x20;\n\n    *   `$0.path` &#x20;\n    *   `$0.withdrawalData` &#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n#### signWithdrawal\n\nSigns an Acre Withdrawal message with the private key at\nthe provided derivation path according to the Bitcoin Signature format\nand returns v, r, s.\n\n##### Parameters\n\n*   `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), withdrawalData: [AcreWithdrawalData](#acrewithdrawaldata)}**\n\n    *   `$0.path` &#x20;\n    *   `$0.withdrawalData` &#x20;\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n#### signERC4361Message\n\nSigns an ERC-4361 (Sign-In with Ethereum) formatted message with the private key at\nthe provided derivation path according to the Bitcoin Signature format\nand returns v, r, s.\n\n##### Parameters\n\n*   `$0` **{path: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), messageHex: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}**\n\n    *   `$0.path` The BIP32 derivation path of the key to use for signing\n    *   `$0.messageHex` The ERC-4361 formatted message to sign, in hexadecimal format\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{v: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), r: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), s: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n### descrTemplFrom\n\nThis function returns a descriptor template based on the address format.\nSee <https://github.com/blooo-io/app-acre/blob/develop/doc/wallet.md> for details of\nthe bitcoin descriptor template.\n\n#### Parameters\n\n*   `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a BIP 32 path\n*   `opts` **{verify: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, format: [AddressFormat](#addressformat)?}?**&#x20;\n*   `options`  an object with optional these fields:*   verify (boolean) will ask user to confirm the address on the device\n\n    *   format (\"legacy\" | \"p2sh\" | \"bech32\" | \"bech32m\" | \"cashaddr\") to use different bitcoin address formatter.NB The normal usage is to use:*   legacy format with 44' paths\n\n    *   p2sh format with 49' paths\n\n    *   bech32 format with 84' paths\n\n    *   bech32m format with 86' paths\n\n    *   cashaddr in case of Bitcoin Cash\n\n##### Examples\n\n```javascript\nacre.getWalletPublicKey(\"44'/0'/0'/0/0\").then(o => o.bitcoinAddress)\nacre.getWalletPublicKey(\"49'/0'/0'/0/0\", { format: \"p2sh\" }).then(o => o.bitcoinAddress)\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), bitcoinAddress: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), chainCode: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>**&#x20;\n\n#### createPaymentTransaction\n\nTo sign a transaction involving standard (P2PKH) inputs, call createTransaction with the following parameters\n\n##### Parameters\n\n*   `arg` **[CreateTransactionArg](#createtransactionarg)**&#x20;\n*   `inputs`  is an array of \\[ transaction, output\\_index, optional redeem script, optional sequence ] where*   transaction is the previously computed transaction object for this UTXO\n    *   output\\_index is the output in the transaction used as input for this UTXO (counting from 0)\n    *   redeem script is the optional redeem script to use when consuming a Segregated Witness input\n    *   sequence is the sequence number to use for this input (when using RBF), or non present\n*   `associatedKeysets`  is an array of BIP 32 paths pointing to the path to the private key used for each UTXO\n*   `changePath`  is an optional BIP 32 path pointing to the path to the public key used to compute the change address\n*   `outputScriptHex`  is the hexadecimal serialized outputs of the transaction to sign\n*   `lockTime`  is the optional lockTime of the transaction to sign, or default (0)\n*   `sigHashType`  is the hash type of the transaction to sign, or default (all)\n*   `segwit`  is an optional boolean indicating wether to use segwit or not\n*   `additionals`  list of additionnal options*   \"bech32\" for spending native segwit outputs\n    *   \"abc\" for bch\n    *   \"gold\" for btg\n    *   \"decred\" for decred\n    *   \"zcash\" for zcash\n    *   \"bipxxx\" for using BIPxxx\n    *   \"sapling\" to indicate a zec transaction is supporting sapling (to be set over block 419200)\n*   `expiryHeight`  is an optional Buffer for zec overwinter / sapling Txs\n*   `useTrustedInputForSegwit`  trust inputs for segwit transactions\n\n##### Examples\n\n```javascript\nacre.createTransaction({\ninputs: [ [tx1, 1] ],\nassociatedKeysets: [\"0'/0/0\"],\noutputScriptHex: \"01905f0100000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88ac\"\n}).then(res => ...);\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** the signed transaction ready to be broadcast\n\n### CreateTransactionArg\n\nType: {inputs: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]>, associatedKeysets: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>, changePath: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?, outputScriptHex: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), lockTime: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, sigHashType: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, segwit: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, additionals: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>, expiryHeight: [Buffer](https://nodejs.org/api/buffer.html)?, useTrustedInputForSegwit: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, onDeviceStreaming: function (arg0: {progress: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), total: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), index: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}): void?, onDeviceSignatureRequested: function (): void?, onDeviceSignatureGranted: function (): void?}\n\n#### Properties\n\n*   `inputs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]>**&#x20;\n*   `associatedKeysets` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;\n*   `changePath` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;\n*   `outputScriptHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n*   `lockTime` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**&#x20;\n*   `sigHashType` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**&#x20;\n*   `segwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**&#x20;\n*   `additionals` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;\n*   `expiryHeight` **[Buffer](https://nodejs.org/api/buffer.html)?**&#x20;\n*   `useTrustedInputForSegwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**&#x20;\n*   `onDeviceStreaming` **function (arg0: {progress: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), total: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), index: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}): void?**&#x20;\n*   `onDeviceSignatureRequested` **function (): void?**&#x20;\n*   `onDeviceSignatureGranted` **function (): void?**&#x20;\n\n### AcreWithdrawalData\n\nThe AcreWithdrawalData type contains the following properties related to a withdrawal transaction, where each property is a hexadecimal string.\n\n#### Properties\n* `to` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `value` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `data` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `operation` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `safeTxGas` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `baseGas` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `gasPrice` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `gasToken` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `refundReceiver` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n* `nonce` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (hexadecimal)\n\n### AddressFormat\n\naddress format is one of legacy | p2sh | bech32 | bech32m | cashaddr\n\nType: (`\"legacy\"` | `\"p2sh\"` | `\"bech32\"` | `\"bech32m\"` | `\"cashaddr\"`)\n\n### AccountType\n\nEncapsulates differences between account types, for example p2wpkh,\np2wpkhWrapped, p2tr.\n\n#### spendingCondition\n\nGenerates a scriptPubKey (output script) from a list of public keys. If a\np2sh redeemScript or a p2wsh witnessScript is needed it will also be set on\nthe returned SpendingCondition.\n\nThe pubkeys are expected to be 33 byte ecdsa compressed pubkeys.\n\n##### Parameters\n\n*   `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>**&#x20;\n\nReturns **SpendingCondition**&#x20;\n\n#### setInput\n\nPopulates the psbt with account type-specific data for an input.\n\n##### Parameters\n\n*   `i` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The index of the input map to populate\n*   `inputTx` **([Buffer](https://nodejs.org/api/buffer.html) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** The full transaction containing the spent output. This may\n    be omitted for taproot.\n*   `spentOutput` **SpentOutput** The amount and spending condition of the spent output\n*   `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** The 33 byte ecdsa compressed public keys involved in the input\n*   `pathElems` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** The paths corresponding to the pubkeys, in same order.\n\nReturns **void**&#x20;\n\n#### setOwnOutput\n\nPopulates the psbt with account type-specific data for an output. This is typically\ndone for change outputs and other outputs that goes to the same account as\nbeing spent from.\n\n##### Parameters\n\n*   `i` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The index of the output map to populate\n*   `cond` **SpendingCondition** The spending condition for this output\n*   `pubkeys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** The 33 byte ecdsa compressed public keys involved in this output\n*   `paths` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>>** The paths corresponding to the pubkeys, in same order.\n\nReturns **void**&#x20;\n\n#### getDescriptorTemplate\n\nReturns the descriptor template for this account type. Currently only\nDefaultDescriptorTemplates are allowed, but that might be changed in the\nfuture. See class WalletPolicy for more information on descriptor\ntemplates.\n\nReturns **DefaultDescriptorTemplate**&#x20;\n\n### SingleKeyAccount\n\n**Extends BaseAccount**\n\nSuperclass for single signature accounts. This will make sure that the pubkey\narrays and path arrays in the method arguments contains exactly one element\nand calls an abstract method to do the actual work.\n\n### getTaprootOutputKey\n\nCalculates a taproot output key from an internal key. This output key will be\nused as witness program in a taproot output. The internal key is tweaked\naccording to recommendation in BIP341:\n<https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#cite_ref-22-0>\n\n#### Parameters\n\n*   `internalPubkey` **[Buffer](https://nodejs.org/api/buffer.html)** A 32 byte x-only taproot internal key\n\nReturns **[Buffer](https://nodejs.org/api/buffer.html)** The output key\n\n### AppClient\n\nThis class encapsulates the APDU protocol documented at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md>\n\n#### Parameters\n\n*   `transport` **Transport**&#x20;\n\n### ClientCommandInterpreter\n\nThis class will dispatch a client command coming from the hardware device to\nthe appropriate client command implementation. Those client commands\ntypically requests data from a merkle tree or merkelized maps.\n\nA ClientCommandInterpreter is prepared by adding the merkle trees and\nmerkelized maps it should be able to serve to the hardware device. This class\ndoesn't know anything about the semantics of the data it holds, it just\nserves merkle data. It doesn't even know in what context it is being\nexecuted, ie SignPsbt, getWalletAddress, etc.\n\nIf the command yelds results to the client, as signPsbt does, the yielded\ndata will be accessible after the command completed by calling getYielded(),\nwhich will return the yields in the same order as they came in.\n\n#### Parameters\n\n*   `progressCallback` **function (): void**&#x20;\n\n### MerkelizedPsbt\n\n**Extends PsbtV2**\n\nThis class merkelizes a PSBTv2, by merkelizing the different\nmaps of the psbt. This is used during the transaction signing process,\nwhere the hardware app can request specific parts of the psbt from the\nclient code and be sure that the response data actually belong to the psbt.\nThe reason for this is the limited amount of memory available to the app,\nso it can't always store the full psbt in memory.\n\nThe signing process is documented at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/acre.md#sign_psbt>\n\n#### Parameters\n\n*   `psbt` **[PsbtV2](#psbtv2)**&#x20;\n\n### Merkle\n\nThis class implements the merkle tree used by Ledger Acre app,\nwhich is documented at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/merkle.md>\n\n#### Parameters\n\n*   `leaves` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>**&#x20;\n*   `hasher` **function (buf: [Buffer](https://nodejs.org/api/buffer.html)): [Buffer](https://nodejs.org/api/buffer.html)**  (optional, default `crypto.sha256`)\n\n### MerkleMap\n\nThis implements \"Merkelized Maps\", documented at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/merkle.md#merkleized-maps>\n\nA merkelized map consist of two merkle trees, one for the keys of\na map and one for the values of the same map, thus the two merkle\ntrees have the same shape. The commitment is the number elements\nin the map followed by the keys' merkle root followed by the\nvalues' merkle root.\n\n#### Parameters\n\n*   `keys` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** Sorted list of (unhashed) keys\n*   `values` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Buffer](https://nodejs.org/api/buffer.html)>** values, in corresponding order as the keys, and of equal length\n\n### WalletPolicy\n\nThe Bitcon hardware app uses a descriptors-like thing to describe\nhow to construct output scripts from keys. A \"Wallet Policy\" consists\nof a \"Descriptor Template\" and a list of \"keys\". A key is basically\na serialized BIP32 extended public key with some added derivation path\ninformation. This is documented at\n<https://github.com/blooo-io/app-acre/blob/develop/doc/wallet.md>\n\n#### Parameters\n\n*   `descriptorTemplate` **DefaultDescriptorTemplate**&#x20;\n*   `key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n\n### extract\n\nThis implements the \"Transaction Extractor\" role of BIP370 (PSBTv2\n<https://github.com/bitcoin/bips/blob/master/bip-0370.mediawiki#transaction-extractor>). However\nthe role is partially documented in BIP174 (PSBTv0\n<https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#transaction-extractor>).\n\n#### Parameters\n\n*   `psbt` **[PsbtV2](#psbtv2)**&#x20;\n\nReturns **[Buffer](https://nodejs.org/api/buffer.html)**&#x20;\n\n### finalize\n\nThis roughly implements the \"input finalizer\" role of BIP370 (PSBTv2\n<https://github.com/bitcoin/bips/blob/master/bip-0370.mediawiki>). However\nthe role is documented in BIP174 (PSBTv0\n<https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki>).\n\nVerify that all inputs have a signature, and set inputFinalScriptwitness\nand/or inputFinalScriptSig depending on the type of the spent outputs. Clean\nfields that aren't useful anymore, partial signatures, redeem script and\nderivation paths.\n\n#### Parameters\n\n*   `psbt` **[PsbtV2](#psbtv2)** The psbt with all signatures added as partial sigs, either\n    through PSBT\\_IN\\_PARTIAL\\_SIG or PSBT\\_IN\\_TAP\\_KEY\\_SIG\n\nReturns **void**&#x20;\n\n### clearFinalizedInput\n\nDeletes fields that are no longer neccesary from the psbt.\n\nNote, the spec doesn't say anything about removing ouput fields\nlike PSBT\\_OUT\\_BIP32\\_DERIVATION\\_PATH and others, so we keep them\nwithout actually knowing why. I think we should remove them too.\n\n#### Parameters\n\n*   `psbt` **[PsbtV2](#psbtv2)**&#x20;\n*   `inputIndex` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;\n\n### writePush\n\nWrites a script push operation to buf, which looks different\ndepending on the size of the data. See\n<https://en.bitcoin.it/wiki/Script#Constants>\n\n#### Parameters\n\n*   `buf` **BufferWriter** the BufferWriter to write to\n*   `data` **[Buffer](https://nodejs.org/api/buffer.html)** the Buffer to be pushed.\n\n### PsbtV2\n\nImplements Partially Signed Bitcoin Transaction version 2, BIP370, as\ndocumented at <https://github.com/bitcoin/bips/blob/master/bip-0370.mediawiki>\nand <https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki>\n\nA psbt is a data structure that can carry all relevant information about a\ntransaction through all stages of the signing process. From constructing an\nunsigned transaction to extracting the final serialized transaction ready for\nbroadcast.\n\nThis implementation is limited to what's needed in ledgerjs to carry out its\nduties, which means that support for features like multisig or taproot script\npath spending are not implemented. Specifically, it supports p2pkh,\np2wpkhWrappedInP2sh, p2wpkh and p2tr key path spending.\n\nThis class is made purposefully dumb, so it's easy to add support for\ncomplemantary fields as needed in the future.\n\n### serializeTransactionOutputs\n\n#### Parameters\n\n*   `$0` **[Transaction](#transaction)**&#x20;\n\n    *   `$0.outputs` &#x20;\n\n#### Examples\n\n```javascript\nconst tx1 = acre.splitTransaction(\"01000000014ea60aeac5252c14291d428915bd7ccd1bfc4af009f4d4dc57ae597ed0420b71010000008a47304402201f36a12c240dbf9e566bc04321050b1984cd6eaf6caee8f02bb0bfec08e3354b022012ee2aeadcbbfd1e92959f57c15c1c6debb757b798451b104665aa3010569b49014104090b15bde569386734abf2a2b99f9ca6a50656627e77de663ca7325702769986cf26cc9dd7fdea0af432c8e2becc867c932e1b9dd742f2a108997c2252e2bdebffffffff0281b72e00000000001976a91472a5d75c8d2d0565b656a5232703b167d50d5a2b88aca0860100000000001976a9144533f5fb9b4817f713c48f0bfe96b9f50c476c9b88ac00000000\");\nconst outputScript = acre.serializeTransactionOutputs(tx1).toString('hex');\n```\n\nReturns **[Buffer](https://nodejs.org/api/buffer.html)**&#x20;\n\n### SignP2SHTransactionArg\n\nType: {inputs: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]>, associatedKeysets: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>, outputScriptHex: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), lockTime: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, sigHashType: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?, segwit: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?, transactionVersion: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?}\n\n#### Properties\n\n*   `inputs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<\\[[Transaction](#transaction), [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), ([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)), ([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | null | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))]>**&#x20;\n*   `associatedKeysets` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;\n*   `outputScriptHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;\n*   `lockTime` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**&#x20;\n*   `sigHashType` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**&#x20;\n*   `segwit` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**&#x20;\n*   `transactionVersion` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**&#x20;\n\n### TransactionInput\n\n### TransactionOutput\n\n### Transaction\n","readmeFilename":"README.md"}