├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── src ├── blockstream_utils.ts ├── pay_to_addition_script.ts ├── pay_to_address_with_secret.ts └── witness_stack_to_script_witness.ts ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Oghenovo Usiwoma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # scripting-with-bitcoinjs 2 | A project showing how to use bitcoinjs to create P2WSH addresses and spend from these addresses 3 | 4 | ## Running the examples 5 | 6 | Install dependencies 7 | `yarn install` 8 | 9 | Run the pay to addition script example 10 | `yarn run:p2_addition_script` 11 | 12 | Run the pay to address with secret example 13 | `yarn run:p2_address_with_secret` -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "scripting-with-bitcoinjs", 3 | "version": "1.0.0", 4 | "main": "dist/index.js", 5 | "repository": "git@github.com:Eunovo/scripting-with-bitcoinjs.git", 6 | "author": "Eunovo ", 7 | "license": "MIT", 8 | "devDependencies": { 9 | "@types/node": "^18.11.18", 10 | "typescript": "^4.9.4" 11 | }, 12 | "dependencies": { 13 | "axios": "^1.2.6", 14 | "bitcoinjs-lib": "^6.1.0", 15 | "ecpair": "^2.1.0", 16 | "tiny-secp256k1": "^2.2.1", 17 | "varuint-bitcoin": "^1.1.2" 18 | }, 19 | "scripts": { 20 | "build": "tsc", 21 | "run:p2_addition_script": "yarn build && node dist/pay_to_addition_script.js", 22 | "run:p2_address_with_secret": "yarn build && node dist/pay_to_address_with_secret.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/blockstream_utils.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosResponse } from "axios"; 2 | 3 | const blockstream = new axios.Axios({ 4 | baseURL: `https://blockstream.info/testnet/api` 5 | }); 6 | 7 | export async function waitUntilUTXO(address: string) { 8 | return new Promise((resolve, reject) => { 9 | let intervalId: any; 10 | const checkForUtxo = async () => { 11 | try { 12 | const response: AxiosResponse = await blockstream.get(`/address/${address}/utxo`); 13 | const data: IUTXO[] = response.data ? JSON.parse(response.data) : undefined; 14 | console.log(data); 15 | if (data.length > 0) { 16 | resolve(data); 17 | clearInterval(intervalId); 18 | } 19 | } catch (error) { 20 | reject(error); 21 | clearInterval(intervalId); 22 | } 23 | }; 24 | intervalId = setInterval(checkForUtxo, 10000); 25 | }); 26 | } 27 | 28 | export async function broadcast(txHex: string) { 29 | const response: AxiosResponse = await blockstream.post('/tx', txHex); 30 | return response.data; 31 | } 32 | 33 | interface IUTXO { 34 | txid: string; 35 | vout: number; 36 | status: { 37 | confirmed: boolean; 38 | block_height: number; 39 | block_hash: string; 40 | block_time: number; 41 | }; 42 | value: number; 43 | } 44 | -------------------------------------------------------------------------------- /src/pay_to_addition_script.ts: -------------------------------------------------------------------------------- 1 | import { networks, script, opcodes, payments, Psbt } from "bitcoinjs-lib"; 2 | import { broadcast, waitUntilUTXO } from "./blockstream_utils"; 3 | import { witnessStackToScriptWitness } from "./witness_stack_to_script_witness"; 4 | 5 | console.log(`Running "Pay to Addition Script example"`); 6 | 7 | const network = networks.testnet; 8 | 9 | const locking_script = script.compile([ 10 | opcodes.OP_ADD, 11 | script.number.encode(5), 12 | opcodes.OP_EQUAL 13 | ]); 14 | 15 | const p2wsh = payments.p2wsh({ redeem: { output: locking_script, network }, network }); 16 | const p2wshAddr = p2wsh.address ?? ""; 17 | console.log(`Address: ${p2wshAddr}`); 18 | 19 | waitUntilUTXO(p2wshAddr) 20 | .then(async (data) => { 21 | console.log(`Using UTXO ${data[0].txid}:${data[0].vout}`); 22 | 23 | const psbt = new Psbt({ network }); 24 | psbt.addInput({ 25 | hash: data[0].txid, 26 | index: data[0].vout, 27 | witnessUtxo: { 28 | script: p2wsh.output!, 29 | value: data[0].value // in Satoshis 30 | }, 31 | witnessScript: locking_script 32 | }); 33 | 34 | psbt.addOutput({ 35 | address: "mohjSavDdQYHRYXcS3uS6ttaHP8amyvX78", // faucet address 36 | value: data[0].value - 200 37 | }); 38 | 39 | const finalizeInput = (_inputIndex: number, input: any) => { 40 | const redeemPayment = payments.p2wsh({ 41 | redeem: { 42 | input: script.compile([ 43 | script.number.encode(1), 44 | script.number.encode(4) 45 | ]), 46 | output: input.witnessScript 47 | } 48 | }); 49 | 50 | const finalScriptWitness = witnessStackToScriptWitness( 51 | redeemPayment.witness ?? [] 52 | ); 53 | 54 | return { 55 | finalScriptSig: Buffer.from(""), 56 | finalScriptWitness 57 | } 58 | } 59 | 60 | psbt.finalizeInput(0, finalizeInput); 61 | 62 | const tx = psbt.extractTransaction(); 63 | console.log(`Broadcasting Transaction Hex: ${tx.toHex()}`); 64 | const txid = await broadcast(tx.toHex()); 65 | console.log(`Success! Txid is ${txid}`); 66 | }); 67 | 68 | console.log(`Waiting for payment to address: ${p2wshAddr}`); 69 | -------------------------------------------------------------------------------- /src/pay_to_address_with_secret.ts: -------------------------------------------------------------------------------- 1 | import { 2 | networks, 3 | script, 4 | opcodes, 5 | payments, 6 | crypto, 7 | Psbt 8 | } from "bitcoinjs-lib"; 9 | import { broadcast, waitUntilUTXO } from "./blockstream_utils"; 10 | import { witnessStackToScriptWitness } from "./witness_stack_to_script_witness"; 11 | import { ECPairFactory, ECPairAPI, TinySecp256k1Interface } from 'ecpair'; 12 | 13 | const tinysecp: TinySecp256k1Interface = require('tiny-secp256k1'); 14 | const ECPair: ECPairAPI = ECPairFactory(tinysecp); 15 | 16 | console.log(`Running "Pay to Addition Script example"`); 17 | 18 | const network = networks.testnet; 19 | const SECRET = "secret"; 20 | 21 | const keypair = ECPair.makeRandom({ network }); 22 | 23 | const preimage = Buffer.from(SECRET); 24 | const hash = crypto.hash160(preimage); 25 | const publicKey = keypair.publicKey; 26 | const recipAddr = crypto.hash160(publicKey); 27 | const locking_script = script.compile([ 28 | opcodes.OP_HASH160, 29 | hash, 30 | opcodes.OP_EQUALVERIFY, 31 | opcodes.OP_DUP, 32 | opcodes.OP_HASH160, 33 | recipAddr, 34 | opcodes.OP_EQUALVERIFY, 35 | opcodes.OP_CHECKSIG, 36 | ]); 37 | 38 | const p2wsh = payments.p2wsh({ redeem: { output: locking_script, network }, network }); 39 | const p2wshAddr = p2wsh.address ?? ""; 40 | console.log(`Address: ${p2wshAddr}`); 41 | 42 | waitUntilUTXO(p2wshAddr) 43 | .then(async (data) => { 44 | console.log(`Using UTXO ${data[0].txid}:${data[0].vout}`); 45 | 46 | const psbt = new Psbt({ network }); 47 | psbt.addInput({ 48 | hash: data[0].txid, 49 | index: data[0].vout, 50 | witnessUtxo: { 51 | script: p2wsh.output!, 52 | value: data[0].value // in Satoshis 53 | }, 54 | witnessScript: locking_script 55 | }); 56 | 57 | psbt.addOutput({ 58 | address: "mohjSavDdQYHRYXcS3uS6ttaHP8amyvX78", // faucet address 59 | value: data[0].value - 200 60 | }); 61 | 62 | psbt.signInput(0, keypair); 63 | 64 | const finalizeInput = (_inputIndex: number, input: any) => { 65 | const redeemPayment = payments.p2wsh({ 66 | redeem: { 67 | input: script.compile([ 68 | input.partialSig[0].signature, 69 | publicKey, 70 | preimage 71 | ]), 72 | output: input.witnessScript 73 | } 74 | }); 75 | 76 | const finalScriptWitness = witnessStackToScriptWitness( 77 | redeemPayment.witness ?? [] 78 | ); 79 | 80 | return { 81 | finalScriptSig: Buffer.from(""), 82 | finalScriptWitness 83 | } 84 | } 85 | 86 | psbt.finalizeInput(0, finalizeInput); 87 | 88 | const tx = psbt.extractTransaction(); 89 | console.log(`Broadcasting Transaction Hex: ${tx.toHex()}`); 90 | const txid = await broadcast(tx.toHex()); 91 | console.log(`Success! Txid is ${txid}`); 92 | }); 93 | 94 | console.log(`Waiting for payment to address: ${p2wshAddr}`); 95 | -------------------------------------------------------------------------------- /src/witness_stack_to_script_witness.ts: -------------------------------------------------------------------------------- 1 | import varuint from "varuint-bitcoin"; 2 | 3 | /** 4 | * Helper function that produces a serialized witness script 5 | * https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/csv.spec.ts#L477 6 | */ 7 | export function witnessStackToScriptWitness(witness: Buffer[]) { 8 | let buffer = Buffer.allocUnsafe(0) 9 | 10 | function writeSlice(slice: Buffer) { 11 | buffer = Buffer.concat([buffer, Buffer.from(slice)]) 12 | } 13 | 14 | function writeVarInt(i: number) { 15 | const currentLen = buffer.length; 16 | const varintLen = varuint.encodingLength(i) 17 | 18 | buffer = Buffer.concat([buffer, Buffer.allocUnsafe(varintLen)]) 19 | varuint.encode(i, buffer, currentLen) 20 | } 21 | 22 | function writeVarSlice(slice: Buffer) { 23 | writeVarInt(slice.length) 24 | writeSlice(slice) 25 | } 26 | 27 | function writeVector(vector: Buffer[]) { 28 | writeVarInt(vector.length) 29 | vector.forEach(writeVarSlice) 30 | } 31 | 32 | writeVector(witness) 33 | 34 | return buffer 35 | } 36 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "resolveJsonModule": true, /* Enable importing .json files. */ 39 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 40 | 41 | /* JavaScript Support */ 42 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 43 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 44 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 45 | 46 | /* Emit */ 47 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 48 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 49 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 50 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 51 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 52 | "outDir": "./dist", /* Specify an output folder for all emitted files. */ 53 | // "removeComments": true, /* Disable emitting comments. */ 54 | // "noEmit": true, /* Disable emitting files from a compilation. */ 55 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 56 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 57 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 58 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 60 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 61 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 62 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 63 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 64 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 65 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 66 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 67 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 68 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 69 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 70 | 71 | /* Interop Constraints */ 72 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 73 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 74 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 75 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 76 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 77 | 78 | /* Type Checking */ 79 | "strict": true, /* Enable all strict type-checking options. */ 80 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 81 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 82 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 83 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 84 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 85 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 86 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 87 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 88 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 89 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 90 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 91 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 92 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 93 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 94 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 95 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 96 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 97 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 98 | 99 | /* Completeness */ 100 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 101 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/node@^18.11.18": 6 | version "18.11.18" 7 | resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" 8 | integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== 9 | 10 | asynckit@^0.4.0: 11 | version "0.4.0" 12 | resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" 13 | integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== 14 | 15 | axios@^1.2.6: 16 | version "1.2.6" 17 | resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.6.tgz#eacb6d065baa11bad5959e7ffa0cb6745c65f392" 18 | integrity sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ== 19 | dependencies: 20 | follow-redirects "^1.15.0" 21 | form-data "^4.0.0" 22 | proxy-from-env "^1.1.0" 23 | 24 | base-x@^3.0.2: 25 | version "3.0.9" 26 | resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" 27 | integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== 28 | dependencies: 29 | safe-buffer "^5.0.1" 30 | 31 | bech32@^2.0.0: 32 | version "2.0.0" 33 | resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" 34 | integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== 35 | 36 | bip174@^2.1.0: 37 | version "2.1.0" 38 | resolved "https://registry.yarnpkg.com/bip174/-/bip174-2.1.0.tgz#cd3402581feaa5116f0f00a0eaee87a5843a2d30" 39 | integrity sha512-lkc0XyiX9E9KiVAS1ZiOqK1xfiwvf4FXDDdkDq5crcDzOq+xGytY+14qCsqz7kCiy8rpN1CRNfacRhf9G3JNSA== 40 | 41 | bitcoinjs-lib@^6.1.0: 42 | version "6.1.0" 43 | resolved "https://registry.yarnpkg.com/bitcoinjs-lib/-/bitcoinjs-lib-6.1.0.tgz#2e3123d63eab5e8e752fd7e2f237314f35ed738f" 44 | integrity sha512-eupi1FBTJmPuAZdChnzTXLv2HBqFW2AICpzXZQLniP0V9FWWeeUQSMKES6sP8isy/xO0ijDexbgkdEyFVrsuJw== 45 | dependencies: 46 | bech32 "^2.0.0" 47 | bip174 "^2.1.0" 48 | bs58check "^2.1.2" 49 | create-hash "^1.1.0" 50 | ripemd160 "^2.0.2" 51 | typeforce "^1.11.3" 52 | varuint-bitcoin "^1.1.2" 53 | wif "^2.0.1" 54 | 55 | bs58@^4.0.0: 56 | version "4.0.1" 57 | resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" 58 | integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== 59 | dependencies: 60 | base-x "^3.0.2" 61 | 62 | bs58check@<3.0.0, bs58check@^2.1.2: 63 | version "2.1.2" 64 | resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" 65 | integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== 66 | dependencies: 67 | bs58 "^4.0.0" 68 | create-hash "^1.1.0" 69 | safe-buffer "^5.1.2" 70 | 71 | cipher-base@^1.0.1: 72 | version "1.0.4" 73 | resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" 74 | integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== 75 | dependencies: 76 | inherits "^2.0.1" 77 | safe-buffer "^5.0.1" 78 | 79 | combined-stream@^1.0.8: 80 | version "1.0.8" 81 | resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" 82 | integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== 83 | dependencies: 84 | delayed-stream "~1.0.0" 85 | 86 | create-hash@^1.1.0: 87 | version "1.2.0" 88 | resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" 89 | integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== 90 | dependencies: 91 | cipher-base "^1.0.1" 92 | inherits "^2.0.1" 93 | md5.js "^1.3.4" 94 | ripemd160 "^2.0.1" 95 | sha.js "^2.4.0" 96 | 97 | delayed-stream@~1.0.0: 98 | version "1.0.0" 99 | resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" 100 | integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== 101 | 102 | ecpair@^2.1.0: 103 | version "2.1.0" 104 | resolved "https://registry.yarnpkg.com/ecpair/-/ecpair-2.1.0.tgz#673f826b1d80d5eb091b8e2010c6b588e8d2cb45" 105 | integrity sha512-cL/mh3MtJutFOvFc27GPZE2pWL3a3k4YvzUWEOvilnfZVlH3Jwgx/7d6tlD7/75tNk8TG2m+7Kgtz0SI1tWcqw== 106 | dependencies: 107 | randombytes "^2.1.0" 108 | typeforce "^1.18.0" 109 | wif "^2.0.6" 110 | 111 | follow-redirects@^1.15.0: 112 | version "1.15.2" 113 | resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" 114 | integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== 115 | 116 | form-data@^4.0.0: 117 | version "4.0.0" 118 | resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" 119 | integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== 120 | dependencies: 121 | asynckit "^0.4.0" 122 | combined-stream "^1.0.8" 123 | mime-types "^2.1.12" 124 | 125 | hash-base@^3.0.0: 126 | version "3.1.0" 127 | resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" 128 | integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== 129 | dependencies: 130 | inherits "^2.0.4" 131 | readable-stream "^3.6.0" 132 | safe-buffer "^5.2.0" 133 | 134 | inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: 135 | version "2.0.4" 136 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 137 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 138 | 139 | md5.js@^1.3.4: 140 | version "1.3.5" 141 | resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" 142 | integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== 143 | dependencies: 144 | hash-base "^3.0.0" 145 | inherits "^2.0.1" 146 | safe-buffer "^5.1.2" 147 | 148 | mime-db@1.52.0: 149 | version "1.52.0" 150 | resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" 151 | integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== 152 | 153 | mime-types@^2.1.12: 154 | version "2.1.35" 155 | resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" 156 | integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== 157 | dependencies: 158 | mime-db "1.52.0" 159 | 160 | proxy-from-env@^1.1.0: 161 | version "1.1.0" 162 | resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" 163 | integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== 164 | 165 | randombytes@^2.1.0: 166 | version "2.1.0" 167 | resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" 168 | integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== 169 | dependencies: 170 | safe-buffer "^5.1.0" 171 | 172 | readable-stream@^3.6.0: 173 | version "3.6.0" 174 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" 175 | integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== 176 | dependencies: 177 | inherits "^2.0.3" 178 | string_decoder "^1.1.1" 179 | util-deprecate "^1.0.1" 180 | 181 | ripemd160@^2.0.1, ripemd160@^2.0.2: 182 | version "2.0.2" 183 | resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" 184 | integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== 185 | dependencies: 186 | hash-base "^3.0.0" 187 | inherits "^2.0.1" 188 | 189 | safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: 190 | version "5.2.1" 191 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" 192 | integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== 193 | 194 | sha.js@^2.4.0: 195 | version "2.4.11" 196 | resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" 197 | integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== 198 | dependencies: 199 | inherits "^2.0.1" 200 | safe-buffer "^5.0.1" 201 | 202 | string_decoder@^1.1.1: 203 | version "1.3.0" 204 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" 205 | integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== 206 | dependencies: 207 | safe-buffer "~5.2.0" 208 | 209 | tiny-secp256k1@^2.2.1: 210 | version "2.2.1" 211 | resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-2.2.1.tgz#a61d4791b7031aa08a9453178a131349c3e10f9b" 212 | integrity sha512-/U4xfVqnVxJXN4YVsru0E6t5wVncu2uunB8+RVR40fYUxkKYUPS10f+ePQZgFBoE/Jbf9H1NBveupF2VmB58Ng== 213 | dependencies: 214 | uint8array-tools "0.0.7" 215 | 216 | typeforce@^1.11.3, typeforce@^1.18.0: 217 | version "1.18.0" 218 | resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" 219 | integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== 220 | 221 | typescript@^4.9.4: 222 | version "4.9.4" 223 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" 224 | integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== 225 | 226 | uint8array-tools@0.0.7: 227 | version "0.0.7" 228 | resolved "https://registry.yarnpkg.com/uint8array-tools/-/uint8array-tools-0.0.7.tgz#a7a2bb5d8836eae2fade68c771454e6a438b390d" 229 | integrity sha512-vrrNZJiusLWoFWBqz5Y5KMCgP9W9hnjZHzZiZRT8oNAkq3d5Z5Oe76jAvVVSRh4U8GGR90N2X1dWtrhvx6L8UQ== 230 | 231 | util-deprecate@^1.0.1: 232 | version "1.0.2" 233 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 234 | integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== 235 | 236 | varuint-bitcoin@^1.1.2: 237 | version "1.1.2" 238 | resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz#e76c138249d06138b480d4c5b40ef53693e24e92" 239 | integrity sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw== 240 | dependencies: 241 | safe-buffer "^5.1.1" 242 | 243 | wif@^2.0.1, wif@^2.0.6: 244 | version "2.0.6" 245 | resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" 246 | integrity sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ== 247 | dependencies: 248 | bs58check "<3.0.0" 249 | --------------------------------------------------------------------------------