From 67f13c4e27cf6972c4fe32f06abd2f03e6f5be43 Mon Sep 17 00:00:00 2001 From: k-matsuzawa <49718559+ko-matsu@users.noreply.github.com> Date: Fri, 4 Sep 2020 20:31:07 +0900 Subject: [PATCH] update to v0.1.6 (#17) Co-authored-by: k-matsuzawa --- .github/workflows/check_pre-merge_develop.yml | 20 +- .github/workflows/check_pre-merge_master.yml | 20 +- .github/workflows/check_pre-merge_sprint.yml | 19 +- .../workflows/create_release-and-upload.yml | 25 +- external/CMakeLists.txt | 72 +- include/cfdjs/cfdjs_struct.h | 9 +- index.d.ts | 763 +++++++++++++++++- package-lock.json | 761 +++++++---------- package.json | 12 +- src/CMakeLists.txt | 6 +- src/autogen/cfd_js_api_json_autogen.cpp | 27 +- src/autogen/cfd_js_api_json_autogen.h | 131 ++- src/cfdjs_elements_transaction.cpp | 1 + src/cfdjs_transaction.cpp | 1 + .../cfdapi_add_multisig_sign.json | 25 +- .../cfdapi_add_pubkey_hash_sign.json | 23 +- .../cfdapi_add_raw_transaction.json | 18 +- .../cfdapi_add_script_hash_sign.json | 23 +- src/input_json_format/cfdapi_add_sign.json | 26 +- .../cfdapi_append_descriptor_checksum.json | 10 +- .../cfdapi_blind_raw_transaction.json | 43 +- .../cfdapi_calculate_ec_signature.json | 17 +- src/input_json_format/cfdapi_convert_aes.json | 10 +- .../cfdapi_estimate_fee.json | 9 +- tools/generate_json_map_class.ts | 203 ++++- wrap_js/__test__/EstimateFee.spec.js | 73 +- wrap_js/__test__/FundRawTransaction.spec.js | 30 + 27 files changed, 1653 insertions(+), 724 deletions(-) diff --git a/.github/workflows/check_pre-merge_develop.yml b/.github/workflows/check_pre-merge_develop.yml index c8e4c90b..f33fa295 100644 --- a/.github/workflows/check_pre-merge_develop.yml +++ b/.github/workflows/check_pre-merge_develop.yml @@ -11,7 +11,6 @@ on: - test_ci env: - CMAKE_VERSION: 3.15.5 CMAKE_BUILD_PARALLEL_LEVEL: 4 jobs: @@ -21,28 +20,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - node: [8, 12, 13, 14] + os: [macos-latest, ubuntu-latest] + node: [8, 12, 14] exclude: - - os: windows-latest - node: 8 - os: macos-latest node: 8 - - os: macos-latest - node: 13 steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.0 + - uses: actions/setup-node@v2.1.1 continue-on-error: true timeout-minutes: 1 with: node-version: ${{ matrix.node }} - - name: setup-node retry - uses: actions/setup-node@v2.1.0 - timeout-minutes: 1 - with: - node-version: ${{ matrix.node }} - name: dump node version id: node_ver run: | @@ -62,13 +52,13 @@ jobs: id: npm_info run: | npm --version - echo "::set-output name=npm_cachedir::$(npm config get cache)" + echo "::set-output name=temp_npm_cachedir::$(npm config get cache)" - name: use npm cache if: matrix.os != 'windows-latest' && steps.node_cache.outputs.cache-hit != 'true' uses: actions/cache@v1 id: npm_cache with: - path: ${{ steps.npm_info.outputs.npm_cachedir }} + path: ${{ steps.npm_info.outputs.temp_npm_cachedir }} key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0 restore-keys: | npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}- diff --git a/.github/workflows/check_pre-merge_master.yml b/.github/workflows/check_pre-merge_master.yml index ea5fb10f..b950ea25 100644 --- a/.github/workflows/check_pre-merge_master.yml +++ b/.github/workflows/check_pre-merge_master.yml @@ -9,7 +9,6 @@ on: - master env: - CMAKE_VERSION: 3.15.5 CMAKE_BUILD_PARALLEL_LEVEL: 4 jobs: @@ -19,28 +18,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, windows-latest, ubuntu-latest] - node: [8, 12, 13, 14] + os: [macos-latest, ubuntu-latest] + node: [8, 12, 14] exclude: - - os: windows-latest - node: 8 - os: macos-latest node: 8 - - os: macos-latest - node: 13 steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.0 + - uses: actions/setup-node@v2.1.1 continue-on-error: true timeout-minutes: 1 with: node-version: ${{ matrix.node }} - - name: setup-node retry - uses: actions/setup-node@v2.1.0 - timeout-minutes: 1 - with: - node-version: ${{ matrix.node }} - name: dump node version id: node_ver run: | @@ -60,13 +50,13 @@ jobs: id: npm_info run: | npm --version - echo "::set-output name=npm_cachedir::$(npm config get cache)" + echo "::set-output name=temp_npm_cachedir::$(npm config get cache)" - name: use npm cache if: matrix.os != 'windows-latest' && steps.node_cache.outputs.cache-hit != 'true' uses: actions/cache@v1 id: npm_cache with: - path: ${{ steps.npm_info.outputs.npm_cachedir }} + path: ${{ steps.npm_info.outputs.temp_npm_cachedir }} key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0 restore-keys: | npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}- diff --git a/.github/workflows/check_pre-merge_sprint.yml b/.github/workflows/check_pre-merge_sprint.yml index 0b8b6226..9057a145 100644 --- a/.github/workflows/check_pre-merge_sprint.yml +++ b/.github/workflows/check_pre-merge_sprint.yml @@ -9,7 +9,6 @@ on: - features/sprint* env: - CMAKE_VERSION: 3.15.5 CMAKE_BUILD_PARALLEL_LEVEL: 4 jobs: @@ -19,28 +18,22 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + # os: [macos-latest, windows-latest, ubuntu-latest] + os: [macos-latest, ubuntu-latest] node: [8, 12, 14] exclude: - - os: windows-latest - node: 8 - os: macos-latest node: 8 - os: macos-latest - node: 14 + node: 12 steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v2.1.0 + - uses: actions/setup-node@v2.1.1 continue-on-error: true timeout-minutes: 1 with: node-version: ${{ matrix.node }} - - name: setup-node retry - uses: actions/setup-node@v2.1.0 - timeout-minutes: 1 - with: - node-version: ${{ matrix.node }} - name: dump node version id: node_ver run: | @@ -60,13 +53,13 @@ jobs: id: npm_info run: | npm --version - echo "::set-output name=npm_cachedir::$(npm config get cache)" + echo "::set-output name=temp_npm_cachedir::$(npm config get cache)" - name: use npm cache if: matrix.os != 'windows-latest' && steps.node_cache.outputs.cache-hit != 'true' uses: actions/cache@v1 id: npm_cache with: - path: ${{ steps.npm_info.outputs.npm_cachedir }} + path: ${{ steps.npm_info.outputs.temp_npm_cachedir }} key: npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}-0 restore-keys: | npm-${{ runner.os }}-${{ matrix.node }}-${{ steps.node_ver.outputs.node_version }}- diff --git a/.github/workflows/create_release-and-upload.yml b/.github/workflows/create_release-and-upload.yml index 636782d3..5d8489de 100644 --- a/.github/workflows/create_release-and-upload.yml +++ b/.github/workflows/create_release-and-upload.yml @@ -73,10 +73,6 @@ jobs: id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} shell: bash -# run: | -# echo "##[set-output name=VERSION;]$(echo ${GITHUB_REF#refs/tags/})" -# echo "CMAKE_VERSION=${env:CMAKE_VERSION}" > cmake_ver.txt -# cat cmake_ver.txt - name: dump version env: version: ${{ steps.get_version.outputs.VERSION }} @@ -118,16 +114,17 @@ jobs: asset_path: ./cfd.zip asset_name: cfdjs-api-${{ steps.get_version.outputs.VERSION }}-win-vs2019-x86_64.zip asset_content_type: application/zip - - name: npm install - run: npm install - timeout-minutes: 20 - - name: prebuild - run: npm run prebuild_all - - name: prebuild upload - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npm run prebuild_upload_all -- ${GITHUB_TOKEN} - shell: bash +# Comment out until the node addon's build on windows is possible. +# - name: npm install +# run: npm install +# timeout-minutes: 20 +# - name: prebuild +# run: npm run prebuild_all +# - name: prebuild upload +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: npm run prebuild_upload_all -- ${GITHUB_TOKEN} +# shell: bash upload-object-ubuntu: name: upload-object-ubuntu diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 6042e38b..55e9f9f7 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -39,8 +39,10 @@ set(CFDJS_API_INSTALLED TRUE) endif() # find_package endif() -find_package(cfd QUIET CONFIG) +find_package(univalue QUIET CONFIG) +find_package(wally QUIET CONFIG) find_package(cfdcore QUIET CONFIG) +find_package(cfd QUIET CONFIG) if((NOT CFDJS_API_INSTALLED) OR (NOT cfd_FOUND) OR (NOT ${cfd_FOUND}) OR (NOT cfdcore_FOUND) OR (NOT ${cfdcore_FOUND})) # load and compile libwally else() @@ -64,31 +66,24 @@ include(${CMAKE_CURRENT_BINARY_DIR}/${EXTERNAL_LOCAL_CURRENT_FILENAME}.cmake) message(STATUS "[external project local] load current cfd-js file") endif() -if(NOT CFDJS_API_INSTALLED) -# cfd -if(CFD_TARGET_VERSION) -set(CFD_TARGET_TAG ${CFD_TARGET_VERSION}) -message(STATUS "[external project local] cfd target=${CFD_TARGET_VERSION}") -else() -set(CFD_TARGET_TAG v0.1.5) -endif() -if(CFD_TARGET_URL) -set(CFD_TARGET_REP ${CFD_TARGET_URL}) -message(STATUS "[external project local] cfd url=${CFD_TARGET_URL}") +# libwally-core (force build on wallycore.node) +if(LIBWALLY_TARGET_VERSION) +set(LIBWALLY_TARGET_TAG ${LIBWALLY_TARGET_VERSION}) +message(STATUS "[external project cfd-js local] libwally-core target=${LIBWALLY_TARGET_VERSION}") else() -set(CFD_TARGET_REP p2pderivatives/cfd.git) +set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.0.6) endif() if(${USE_GIT_SSH}) -set(CFD_URL git@github.com:${CFD_TARGET_REP}) +set(LIBWALLY_URL git@github.com:cryptogarageinc/libwally-core.git) else() -set(CFD_URL https://github.com/${CFD_TARGET_REP}) +set(LIBWALLY_URL https://github.com/cryptogarageinc/libwally-core.git) endif() -set(TEMPLATE_PROJECT_NAME cfd) -set(TEMPLATE_PROJECT_GIT_REPOSITORY ${CFD_URL}) -set(TEMPLATE_PROJECT_GIT_TAG ${CFD_TARGET_TAG}) +set(TEMPLATE_PROJECT_NAME libwally-core) +set(TEMPLATE_PROJECT_GIT_REPOSITORY ${LIBWALLY_URL}) +set(TEMPLATE_PROJECT_GIT_TAG ${LIBWALLY_TARGET_TAG}) set(PROJECT_EXTERNAL "${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME}/external") set(DIR_PATH "${CFD_ROOT_BINARY_DIR}/${TEMPLATE_PROJECT_NAME}") set(DL_PATH "${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/download") @@ -97,6 +92,7 @@ get_property(PROP_VALUE GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME}) if(PROP_VALUE) message(STATUS "[exist directory] ${TEMPLATE_PROJECT_NAME} exist") else() +message(STATUS "[external project cfd-js] libwally-core target=${LIBWALLY_TARGET_TAG}") configure_file(template_CMakeLists.txt.in ${DL_PATH}/CMakeLists.txt) execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S . -B ${DL_PATH} RESULT_VARIABLE result @@ -117,36 +113,37 @@ if(EXISTS ${PROJECT_EXTERNAL}) ${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/external) endif() -if((NOT cfd_FOUND) OR (NOT ${cfd_FOUND})) add_subdirectory(${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME} ${DIR_PATH}/build) -else() -message(STATUS "[external project local] use cfd cache") -endif((NOT cfd_FOUND) OR (NOT ${cfd_FOUND})) - set_property(GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME} 1) endif() -endif(NOT CFDJS_API_INSTALLED) +if(NOT CFDJS_API_INSTALLED) -# libwally-core (force build on wallycore.node) -if(LIBWALLY_TARGET_VERSION) -set(LIBWALLY_TARGET_TAG ${LIBWALLY_TARGET_VERSION}) -message(STATUS "[external project cfd-js local] libwally-core target=${LIBWALLY_TARGET_VERSION}") +# cfd +if(CFD_TARGET_VERSION) +set(CFD_TARGET_TAG ${CFD_TARGET_VERSION}) +message(STATUS "[external project local] cfd target=${CFD_TARGET_VERSION}") +else() +set(CFD_TARGET_TAG v0.1.6) +endif() +if(CFD_TARGET_URL) +set(CFD_TARGET_REP ${CFD_TARGET_URL}) +message(STATUS "[external project local] cfd url=${CFD_TARGET_URL}") else() -set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.0.4) +set(CFD_TARGET_REP p2pderivatives/cfd.git) endif() if(${USE_GIT_SSH}) -set(LIBWALLY_URL git@github.com:cryptogarageinc/libwally-core.git) +set(CFD_URL git@github.com:${CFD_TARGET_REP}) else() -set(LIBWALLY_URL https://github.com/cryptogarageinc/libwally-core.git) +set(CFD_URL https://github.com/${CFD_TARGET_REP}) endif() -set(TEMPLATE_PROJECT_NAME libwally-core) -set(TEMPLATE_PROJECT_GIT_REPOSITORY ${LIBWALLY_URL}) -set(TEMPLATE_PROJECT_GIT_TAG ${LIBWALLY_TARGET_TAG}) +set(TEMPLATE_PROJECT_NAME cfd) +set(TEMPLATE_PROJECT_GIT_REPOSITORY ${CFD_URL}) +set(TEMPLATE_PROJECT_GIT_TAG ${CFD_TARGET_TAG}) set(PROJECT_EXTERNAL "${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME}/external") set(DIR_PATH "${CFD_ROOT_BINARY_DIR}/${TEMPLATE_PROJECT_NAME}") set(DL_PATH "${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/download") @@ -155,7 +152,6 @@ get_property(PROP_VALUE GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME}) if(PROP_VALUE) message(STATUS "[exist directory] ${TEMPLATE_PROJECT_NAME} exist") else() -message(STATUS "[external project cfd-js] libwally-core target=${LIBWALLY_TARGET_TAG}") configure_file(template_CMakeLists.txt.in ${DL_PATH}/CMakeLists.txt) execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -S . -B ${DL_PATH} RESULT_VARIABLE result @@ -176,8 +172,14 @@ if(EXISTS ${PROJECT_EXTERNAL}) ${CFD_ROOT_BINARY_DIR}/external/${TEMPLATE_PROJECT_NAME}/external) endif() +if((NOT cfd_FOUND) OR (NOT ${cfd_FOUND})) add_subdirectory(${CMAKE_SOURCE_DIR}/external/${TEMPLATE_PROJECT_NAME} ${DIR_PATH}/build) +else() +message(STATUS "[external project local] use cfd cache") +endif((NOT cfd_FOUND) OR (NOT ${cfd_FOUND})) + set_property(GLOBAL PROPERTY ${TEMPLATE_PROJECT_NAME} 1) endif() +endif(NOT CFDJS_API_INSTALLED) diff --git a/include/cfdjs/cfdjs_struct.h b/include/cfdjs/cfdjs_struct.h index dd736868..a38a37c8 100644 --- a/include/cfdjs/cfdjs_struct.h +++ b/include/cfdjs/cfdjs_struct.h @@ -287,8 +287,8 @@ struct AddSignTxInRequestStruct { * @brief AddSignRequestStruct struct */ struct AddSignRequestStruct { - std::string tx = ""; //!< tx // NOLINT bool is_elements = false; //!< is_elements // NOLINT + std::string tx = ""; //!< tx // NOLINT AddSignTxInRequestStruct txin; //!< txin // NOLINT std::set ignore_items; //!< using on JSON mapping convert. }; @@ -1962,9 +1962,10 @@ struct EstimateFeeRequestStruct { * @brief EstimateFeeResponseStruct struct */ struct EstimateFeeResponseStruct { - int64_t fee_amount = 0; //!< fee_amount // NOLINT - int64_t tx_fee_amount = 0; //!< tx_fee_amount // NOLINT - int64_t utxo_fee_amount = 0; //!< utxo_fee_amount // NOLINT + int64_t fee_amount = 0; //!< fee_amount // NOLINT + int64_t tx_fee_amount = 0; //!< tx_fee_amount // NOLINT + int64_t txout_fee_amount = 0; //!< txout_fee_amount // NOLINT + int64_t utxo_fee_amount = 0; //!< utxo_fee_amount // NOLINT cfd::js::api::InnerErrorResponseStruct error; //!< error information std::set ignore_items; //!< using on JSON mapping convert. }; diff --git a/index.d.ts b/index.d.ts index e76231a4..59dc5386 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,14 @@ /* eslint-disable max-len */ -/* eslint-disable require-jsdoc */ +/* eslint-disable indent */ +/** + * Multisig signature data. + * @property {string} hex - signature hex. + * @property {string} type? - parameter type. (sign only) + * @property {boolean} derEncode? - der encode option flag + * @property {string} sighashType? - signature hash type. (all, none or single) + * @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag. + * @property {string} relatedPubkey? - a pubkey related to signature. + */ export interface MultisigSignData { hex: string; type?: string; @@ -9,26 +18,54 @@ export interface MultisigSignData { relatedPubkey?: string; } +/** + * Multisig signature input data. + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {MultisigSignData[]} signParams - Multisig signature data. + * @property {string} redeemScript? - (required for P2SH or P2SH-P2WSH) redeem script for unlocking script + * @property {string} witnessScript? - (required for P2WSH or P2SH-P2WSH) witness script for witness stack + * @property {string} hashType - hash type. (p2sh, p2wsh or p2sh-p2wsh) + * @property {boolean} clearStack? - Clear the stack before addSign. If txinType is p2sh, clearStack is forced to be true. + */ export interface AddMultisigSignTxInRequest { txid: string; vout: number; - signParams?: MultisigSignData[]; + signParams: MultisigSignData[]; redeemScript?: string; witnessScript?: string; hashType: string; clearStack?: boolean; } +/** + * Multisig input data to add to tx. + * @property {boolean} isElements? - elements transaction flag. + * @property {string} tx - transaction hex + * @property {AddMultisigSignTxInRequest} txin - transaction input data + */ export interface AddMultisigSignRequest { isElements?: boolean; tx: string; - txin?: AddMultisigSignTxInRequest; + txin: AddMultisigSignTxInRequest; } +/** + * The output data with signature added. + * @property {string} hex - signed transaction hex. + */ export interface AddMultisigSignResponse { hex: string; } +/** + * pubkey hash signature data + * @property {string} hex - signature hex. + * @property {string} type? - parameter type. (sign only) + * @property {boolean} derEncode? - der encode option flag + * @property {string} sighashType? - signature hash type. (all, none or single) + * @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag. + */ export interface PubkeyHashSignData { hex: string; type?: string; @@ -37,46 +74,94 @@ export interface PubkeyHashSignData { sighashAnyoneCanPay?: boolean; } +/** + * pubkey hash input data + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {PubkeyHashSignData} signParam - sign parameter. + * @property {string} pubkey - public key. + * @property {string} hashType - hash type. (p2pkh, p2wpkh or p2sh-p2wpkh) + */ export interface AddPubkeyHashSignTxInRequest { txid: string; vout: number; - signParam?: PubkeyHashSignData; + signParam: PubkeyHashSignData; pubkey: string; hashType: string; } +/** + * pubkey hash input data to add to tx. + * @property {boolean} isElements? - elements transaction flag. + * @property {string} tx - transaction hex + * @property {AddPubkeyHashSignTxInRequest} txin - transaction input data + */ export interface AddPubkeyHashSignRequest { isElements?: boolean; tx: string; - txin?: AddPubkeyHashSignTxInRequest; + txin: AddPubkeyHashSignTxInRequest; } +/** + * The output data with signature added. + * @property {string} hex - signed transaction hex. + */ export interface AddPubkeyHashSignResponse { hex: string; } +/** + * The data added to the transaction input. + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {number} sequence? - sequence number. + */ export interface AddTxIn { txid: string; vout: number; sequence?: number; } +/** + * The data added to the transaction output. + * @property {string} address - bitcoin address. + * @property {bigint | number} amount - satoshi amount. + * @property {string} directLockingScript? - Set to locking script. (When using a script that cannot be expressed as an address) + */ export interface AddTxOut { address: string; amount: bigint | number; directLockingScript?: string; } +/** + * The data added to the transaction. + * @property {string} tx - transaction hex + * @property {AddTxIn[]} txins? - The data added to the transaction input. + * @property {AddTxOut[]} txouts? - The data added to the transaction output. + */ export interface AddRawTransactionRequest { tx: string; txins?: AddTxIn[]; txouts?: AddTxOut[]; } +/** + * The output transaction data. + * @property {string} hex - transaction hex. + */ export interface AddRawTransactionResponse { hex: string; } +/** + * signature data + * @property {string} hex - If the type is auto or op_code, character string input is enabled. Others are hex byte array only. + * @property {string} type? - parameter type. (binary, sign) + * @property {boolean} derEncode? - der encode option flag. Valid when type is auto or sign. + * @property {string} sighashType? - signature hash type. (all, none, single) + * @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag. + */ export interface ScriptHashSignData { hex: string; type?: string; @@ -85,6 +170,14 @@ export interface ScriptHashSignData { sighashAnyoneCanPay?: boolean; } +/** + * script hash input data + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {ScriptHashSignData[]} signParam - signature data + * @property {string} redeemScript - redeem script. + * @property {string} hashType - hash type. (p2sh, p2wsh or p2sh-p2wsh) + */ export interface AddScriptHashSignTxInRequest { txid: string; vout: number; @@ -93,16 +186,34 @@ export interface AddScriptHashSignTxInRequest { hashType: string; } +/** + * script hash input data to add to tx. + * @property {boolean} isElements? - elements transaction flag. + * @property {string} tx - transaction hex + * @property {AddScriptHashSignTxInRequest} txin - transaction input data + */ export interface AddScriptHashSignRequest { isElements?: boolean; tx: string; - txin?: AddScriptHashSignTxInRequest; + txin: AddScriptHashSignTxInRequest; } +/** + * The output data with signature added. + * @property {string} hex - signed transaction hex. + */ export interface AddScriptHashSignResponse { hex: string; } +/** + * The sign data. + * @property {string} hex - If the type is auto or op_code, character string input is enabled. Others are hex byte array only. + * @property {string} type? - parameter type. (auto, binary, sign, pubkey, redeem_script, op_code) + * @property {boolean} derEncode? - der encode option flag. Valid when type is auto or sign. + * @property {string} sighashType? - signature hash type. (all, none, single) + * @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag. + */ export interface SignData { hex: string; type?: string; @@ -111,6 +222,14 @@ export interface SignData { sighashAnyoneCanPay?: boolean; } +/** + * Sign input data. + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {boolean} isWitness? - use witness stack flag. + * @property {SignData[]} signParam - The sign data. + * @property {boolean} clearStack? - Clear the stack before addSign. If isWitness is false, clearStack is forced to be true. + */ export interface AddSignTxInRequest { txid: string; vout: number; @@ -119,25 +238,53 @@ export interface AddSignTxInRequest { clearStack?: boolean; } +/** + * Sign input data to add to tx. + * @property {boolean} isElements? - elements transaction flag. + * @property {string} tx - transaction hex + * @property {AddSignTxInRequest} txin - transaction input data + */ export interface AddSignRequest { - tx: string; isElements?: boolean; - txin?: AddSignTxInRequest; + tx: string; + txin: AddSignTxInRequest; } +/** + * The output data with signature added. + * @property {string} hex - signed transaction hex. + */ export interface AddSignResponse { hex: string; } +/** + * The output descriptor request data. + * @property {string} descriptor - output descriptor. + * @property {boolean} isElements? - elements transaction flag. + */ export interface AppendDescriptorChecksumRequest { descriptor: string; isElements?: boolean; } +/** + * The data containing output descriptor. + * @property {string} descriptor - output descriptor. + */ export interface AppendDescriptorChecksumResponse { descriptor: string; } +/** + * Tx input data for blinding. + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {string} asset - asset hex. + * @property {string} blindFactor? - amount blinder. + * @property {string} assetBlindFactor? - asset blinder. + * @property {bigint | number} amount - satoshi amount. + */ export interface BlindTxInRequest { txid: string; vout: number; @@ -147,12 +294,25 @@ export interface BlindTxInRequest { amount: bigint | number; } +/** + * Tx output data for blinding. + * @property {number} index - target txout index. + * @property {string} confidentialKey - confidential key. + * @property {string} blindPubkey? - (deprecated field) + */ export interface BlindTxOutRequest { index: number; confidentialKey: string; blindPubkey?: string; } +/** + * Tx input issuance data for blinding. + * @property {string} txid - utxo txid. + * @property {number} vout - utxo vout. + * @property {string} assetBlindingKey - asset blinding key. + * @property {string} tokenBlindingKey? - token blinding key. Used when issue transaction. + */ export interface BlindIssuanceRequest { txid: string; vout: number; @@ -160,9 +320,19 @@ export interface BlindIssuanceRequest { tokenBlindingKey?: string; } +/** + * Request blind the transaction. + * @property {string} tx - transaction hex + * @property {BlindTxInRequest[]} txins - Tx input data for blinding. + * @property {BlindTxOutRequest[]} txouts? - Tx output data for blinding. + * @property {BlindIssuanceRequest[]} issuances? - Tx input issuance data for blinding. + * @property {bigint | number} minimumRangeValue? - rangeproof minimum value. + * @property {number} exponent? - An exponential value that guarantees a range of rangeproof. + * @property {number} minimumBits? - minimum bits of rangeproof. + */ export interface BlindRawTransactionRequest { tx: string; - txins?: BlindTxInRequest[]; + txins: BlindTxInRequest[]; txouts?: BlindTxOutRequest[]; txoutConfidentialAddresses?: string[]; issuances?: BlindIssuanceRequest[]; @@ -171,10 +341,21 @@ export interface BlindRawTransactionRequest { minimumBits?: number; } +/** + * The data containing blinded transaction. + * @property {string} hex - blinded transaction hex. + */ export interface BlindRawTransactionResponse { hex: string; } +/** + * private key data. + * @property {string} privkey - private key. set is wif or hex. + * @property {boolean} wif - use wif flag. true is wif, false is hex. + * @property {string} network? - wif network type. (mainnet, testnet or regtest) + * @property {boolean} isCompressed? - wif compressed flag + */ export interface PrivkeyData { privkey: string; wif: boolean; @@ -182,16 +363,34 @@ export interface PrivkeyData { isCompressed?: boolean; } +/** + * request ec signature data. + * @property {string} sighash - signature hash. + * @property {PrivkeyData} privkeyData? - private key data. + * @property {boolean} isGrindR? - Grind-R flag + */ export interface CalculateEcSignatureRequest { sighash: string; privkeyData?: PrivkeyData; isGrindR?: boolean; } +/** + * response ec signature data. + * @property {string} signature - ec signature + */ export interface CalculateEcSignatureResponse { signature: string; } +/** + * Request AES data. + * @property {boolean} isEncrypt - aes encrypto flag. true is encrypto, false is decrypto + * @property {string} mode? - AES mode. (for feature) (cbc only) + * @property {string} key - key data (32 byte: 64 char hex) + * @property {string} iv? - initial vector (16 byte: 32 char hex) (using by cbc mode only.) + * @property {string} data - crypto target data + */ export interface ConvertAesRequest { isEncrypt: boolean; mode?: string; @@ -200,19 +399,29 @@ export interface ConvertAesRequest { data: string; } +/** + * The data converted by AES. + * @property {string} hex - encrypted or decrypted data + */ export interface ConvertAesResponse { hex: string; } +/** */ export interface ConvertEntropyToMnemonicRequest { entropy: string; language?: string; } +/** */ export interface ConvertEntropyToMnemonicResponse { mnemonic: string[]; } +/** + * @property {boolean} strictCheck? - Check mnemonic words strictly + * @property {boolean} useIdeographicSpace? - Currently, this flag is valid only the language is set "jp". + */ export interface ConvertMnemonicToSeedRequest { mnemonic: string[]; passphrase: string; @@ -221,16 +430,19 @@ export interface ConvertMnemonicToSeedRequest { useIdeographicSpace?: boolean; } +/** @property {string} entropy? - This field is only set if "language" is set in the request */ export interface ConvertMnemonicToSeedResponse { seed: string; entropy?: string; } +/** */ export interface CreateAddressKeyData { hex: string; type: string; } +/** */ export interface CreateAddressRequest { isElements?: boolean; keyData?: CreateAddressKeyData; @@ -238,28 +450,39 @@ export interface CreateAddressRequest { hashType: string; } +/** + * @property {string} lockingScript - (redeem script or pubkey) locking script + * @property {string} redeemScript? - (required for P2SH-P2WPKH or P2SH-P2WSH) redeem script for unlocking script + */ export interface CreateAddressResponse { address: string; lockingScript: string; redeemScript?: string; } +/** */ export interface CreateDescriptorKeyRequest { key: string; parentExtkey?: string; keyPathFromParent?: string; } +/** + * @property {string} scriptType - Script types are joined by '-'. (ex. p2sh-p2wsh-multi) + * @property {number} requireNum? - multisig require num. + */ export interface CreateDescriptorRequest { scriptType: string; keyInfoList?: CreateDescriptorKeyRequest[]; requireNum?: number; } +/** */ export interface CreateDescriptorResponse { descriptor: string; } +/** */ export interface CreateExtkeyRequest { network: string; extkeyType?: string; @@ -272,10 +495,12 @@ export interface CreateExtkeyRequest { hardened?: boolean; } +/** */ export interface CreateExtkeyResponse { extkey: string; } +/** */ export interface CreateExtkeyFromParentRequest { extkey: string; network: string; @@ -284,10 +509,12 @@ export interface CreateExtkeyFromParentRequest { hardened?: boolean; } +/** */ export interface CreateExtkeyFromParentResponse { extkey: string; } +/** */ export interface CreateExtkeyFromParentKeyRequest { network: string; extkeyType?: string; @@ -298,10 +525,12 @@ export interface CreateExtkeyFromParentKeyRequest { hardened?: boolean; } +/** */ export interface CreateExtkeyFromParentKeyResponse { extkey: string; } +/** */ export interface CreateExtkeyFromParentPathRequest { extkey: string; network: string; @@ -310,40 +539,48 @@ export interface CreateExtkeyFromParentPathRequest { path?: string; } +/** */ export interface CreateExtkeyFromParentPathResponse { extkey: string; } +/** */ export interface CreateExtkeyFromSeedRequest { seed: string; network: string; extkeyType?: string; } +/** */ export interface CreateExtkeyFromSeedResponse { extkey: string; } +/** */ export interface CreateExtPubkeyRequest { extkey: string; network: string; } +/** */ export interface CreateExtPubkeyResponse { extkey: string; } +/** */ export interface CreateKeyPairRequest { wif: boolean; network?: string; isCompressed?: boolean; } +/** */ export interface CreateKeyPairResponse { privkey: string; pubkey: string; } +/** */ export interface MultisigScriptSigData { hex: string; type?: string; @@ -353,51 +590,65 @@ export interface MultisigScriptSigData { relatedPubkey?: string; } +/** @property {string} redeemScript - multisig script */ export interface CreateMultisigScriptSigRequest { signParams?: MultisigScriptSigData[]; redeemScript: string; } +/** */ export interface CreateMultisigScriptSigResponse { hex: string; } +/** */ export interface CreateScriptRequest { items: string[]; } +/** */ export interface CreateScriptResponse { hex: string; } +/** + * @property {string} data - base58 data + * @property {boolean} hasChecksum? - use checksum mode. + */ export interface DecodeBase58Request { data: string; hasChecksum?: boolean; } +/** @property {string} hex - decoded data byte hex */ export interface DecodeBase58Response { hex: string; } +/** @property {string} signature - der signature */ export interface DecodeDerSignatureToRawRequest { signature: string; } +/** */ export interface DecodeDerSignatureToRawResponse { signature: string; } +/** */ export interface DecodeRawTransactionRequest { hex: string; network?: string; iswitness?: boolean; } +/** */ export interface DecodeUnlockingScript { asm?: string; hex?: string; } +/** */ export interface DecodeRawTransactionTxIn { coinbase?: string; txid?: string; @@ -407,6 +658,7 @@ export interface DecodeRawTransactionTxIn { sequence?: number; } +/** */ export interface DecodeLockingScript { asm?: string; hex?: string; @@ -415,12 +667,14 @@ export interface DecodeLockingScript { addresses?: string[]; } +/** */ export interface DecodeRawTransactionTxOut { value: bigint; n: number; scriptPubKey?: DecodeLockingScript; } +/** */ export interface DecodeRawTransactionResponse { txid: string; hash: string; @@ -433,12 +687,14 @@ export interface DecodeRawTransactionResponse { vout?: DecodeRawTransactionTxOut[]; } +/** */ export interface ElementsAddTxInRequest { txid: string; vout: number; sequence?: number; } +/** */ export interface ElementsAddPeginWitness { amount: bigint | number; asset: string; @@ -448,6 +704,7 @@ export interface ElementsAddPeginWitness { mainchainTxoutproof: string; } +/** */ export interface ElementsAddPeginTxIn { txid: string; vout: number; @@ -456,6 +713,7 @@ export interface ElementsAddPeginTxIn { isRemoveMainchainTxWitness?: boolean; } +/** */ export interface ElementsAddTxOut { address: string; amount: bigint | number; @@ -465,12 +723,14 @@ export interface ElementsAddTxOut { isRemoveNonce?: boolean; } +/** */ export interface ElementsAddDestroyAmount { amount: bigint | number; asset: string; directNonce?: string; } +/** */ export interface ElementsAddPegout { amount: bigint | number; asset: string; @@ -485,11 +745,13 @@ export interface ElementsAddPegout { whitelist: string; } +/** */ export interface ElementsAddTxOutFee { amount: bigint | number; asset: string; } +/** @property {string} tx - transaction hex */ export interface ElementsAddRawTransactionRequest { tx: string; txins?: ElementsAddTxInRequest[]; @@ -501,17 +763,20 @@ export interface ElementsAddRawTransactionRequest { isRandomSortTxOut?: boolean; } +/** @property {string} hex - transaction hex */ export interface ElementsAddRawTransactionResponse { hex: string; btcAddresses?: string[]; } +/** */ export interface ElementsDestroyAmountTxIn { txid: string; vout: number; sequence?: number; } +/** */ export interface ElementsDestroyAmountTxOut { address: string; amount: bigint | number; @@ -521,17 +786,20 @@ export interface ElementsDestroyAmountTxOut { isRemoveNonce?: boolean; } +/** */ export interface ElementsDestroyAmount { amount: bigint | number; asset: string; directNonce?: string; } +/** */ export interface ElementsDestroyAmountFee { amount: bigint | number; asset: string; } +/** */ export interface CreateDestroyAmountRequest { version?: number; locktime?: number; @@ -541,10 +809,15 @@ export interface CreateDestroyAmountRequest { fee?: ElementsDestroyAmountFee; } +/** */ export interface CreateDestroyAmountResponse { hex: string; } +/** + * @property {string} pubkey - pubkey related to unlocking peg-in utxo. (This field is only avalable when lockingScript is empty.) + * @property {string} redeemScript? - default is empty. set claim script to direct. + */ export interface CreatePegInAddressRequest { fedpegscript: string; pubkey: string; @@ -553,12 +826,14 @@ export interface CreatePegInAddressRequest { hashType?: string; } +/** */ export interface CreatePegInAddressResponse { mainchainAddress: string; claimScript: string; tweakFedpegscript: string; } +/** */ export interface ElementsPeginWitness { amount: bigint | number; asset: string; @@ -568,6 +843,7 @@ export interface ElementsPeginWitness { mainchainTxoutproof: string; } +/** */ export interface ElementsPeginTxIn { isPegin?: boolean; txid: string; @@ -577,6 +853,7 @@ export interface ElementsPeginTxIn { isRemoveMainchainTxWitness?: boolean; } +/** */ export interface ElementsPeginTxOut { address: string; amount: bigint | number; @@ -586,11 +863,13 @@ export interface ElementsPeginTxOut { isRemoveNonce?: boolean; } +/** */ export interface ElementsPeginTxOutFee { amount: bigint | number; asset: string; } +/** */ export interface CreateRawPeginRequest { version?: number; locktime?: number; @@ -600,16 +879,19 @@ export interface CreateRawPeginRequest { isRandomSortTxOut?: boolean; } +/** */ export interface CreateRawPeginResponse { hex: string; } +/** */ export interface ElementsPegoutTxIn { txid: string; vout: number; sequence?: number; } +/** */ export interface ElementsPegoutTxOut { address: string; amount: bigint | number; @@ -619,6 +901,7 @@ export interface ElementsPegoutTxOut { isRemoveNonce?: boolean; } +/** */ export interface ElementsPegout { amount: bigint | number; asset: string; @@ -633,11 +916,13 @@ export interface ElementsPegout { whitelist: string; } +/** */ export interface ElementsPegoutTxOutFee { amount: bigint | number; asset: string; } +/** */ export interface CreateRawPegoutRequest { version?: number; locktime?: number; @@ -647,17 +932,20 @@ export interface CreateRawPegoutRequest { fee?: ElementsPegoutTxOutFee; } +/** */ export interface CreateRawPegoutResponse { hex: string; btcAddress?: string; } +/** */ export interface ElementsTxInRequest { txid: string; vout: number; sequence?: number; } +/** */ export interface ElementsTxOutRequest { address: string; amount: bigint | number; @@ -667,11 +955,13 @@ export interface ElementsTxOutRequest { isRemoveNonce?: boolean; } +/** */ export interface ElementsTxOutFeeRequest { amount: bigint | number; asset: string; } +/** */ export interface ElementsCreateRawTransactionRequest { version?: number; locktime?: number; @@ -680,10 +970,12 @@ export interface ElementsCreateRawTransactionRequest { fee?: ElementsTxOutFeeRequest; } +/** */ export interface ElementsCreateRawTransactionResponse { hex: string; } +/** @property {boolean} fullDump? - tx data all dump option. */ export interface ElementsDecodeRawTransactionRequest { hex: string; network?: string; @@ -692,11 +984,13 @@ export interface ElementsDecodeRawTransactionRequest { fullDump?: boolean; } +/** */ export interface ElementsDecodeUnlockingScript { asm: string; hex: string; } +/** @property {string} contractHash? - issue original entropy data. */ export interface ElementsDecodeIssuance { assetBlindingNonce: string; assetEntropy: string; @@ -712,6 +1006,7 @@ export interface ElementsDecodeIssuance { tokenRangeproof?: string; } +/** */ export interface ElementsDecodeRawTransactionTxIn { coinbase?: string; txid?: string; @@ -724,6 +1019,7 @@ export interface ElementsDecodeRawTransactionTxIn { issuance?: ElementsDecodeIssuance; } +/** */ export interface ElementsDecodeLockingScript { asm?: string; hex?: string; @@ -738,6 +1034,7 @@ export interface ElementsDecodeLockingScript { pegout_addresses?: string[]; } +/** */ export interface ElementsDecodeRawTransactionTxOut { value?: bigint; 'value-minimum?': bigint; @@ -755,6 +1052,7 @@ export interface ElementsDecodeRawTransactionTxOut { rangeproof?: string; } +/** */ export interface ElementsDecodeRawTransactionResponse { txid: string; hash: string; @@ -769,24 +1067,29 @@ export interface ElementsDecodeRawTransactionResponse { vout?: ElementsDecodeRawTransactionTxOut[]; } +/** */ export interface GetConfidentialAddressRequest { unblindedAddress: string; key: string; } +/** */ export interface GetConfidentialAddressResponse { confidentialAddress: string; } +/** */ export interface GetUnblindedAddressRequest { confidentialAddress: string; } +/** */ export interface GetUnblindedAddressResponse { unblindedAddress: string; confidentialKey: string; } +/** */ export interface IssuanceDataRequest { txid: string; vout: number; @@ -799,12 +1102,14 @@ export interface IssuanceDataRequest { isRemoveNonce?: boolean; } +/** @property {string} tx - transaction hex */ export interface SetRawIssueAssetRequest { tx: string; isRandomSortTxOut?: boolean; issuances: IssuanceDataRequest[]; } +/** */ export interface IssuanceDataResponse { txid: string; vout: number; @@ -813,11 +1118,13 @@ export interface IssuanceDataResponse { token?: string; } +/** */ export interface SetRawIssueAssetResponse { hex: string; issuances: IssuanceDataResponse[]; } +/** */ export interface ReissuanceDataRequest { txid: string; vout: number; @@ -828,12 +1135,14 @@ export interface ReissuanceDataRequest { isRemoveNonce?: boolean; } +/** @property {string} tx - transaction hex */ export interface SetRawReissueAssetRequest { tx: string; isRandomSortTxOut?: boolean; issuances: ReissuanceDataRequest[]; } +/** */ export interface ReissuanceDataResponse { txid: string; vout: number; @@ -841,16 +1150,19 @@ export interface ReissuanceDataResponse { entropy: string; } +/** */ export interface SetRawReissueAssetResponse { hex: string; issuances: ReissuanceDataResponse[]; } +/** */ export interface UnblindTxOut { index: number; blindingKey: string; } +/** */ export interface UnblindIssuance { txid: string; vout: number; @@ -858,12 +1170,14 @@ export interface UnblindIssuance { tokenBlindingKey?: string; } +/** @property {string} tx - transaction hex */ export interface UnblindRawTransactionRequest { tx: string; txouts?: UnblindTxOut[]; issuances?: UnblindIssuance[]; } +/** */ export interface UnblindOutput { index: number; asset: string; @@ -872,6 +1186,7 @@ export interface UnblindOutput { amount: bigint; } +/** */ export interface UnblindIssuanceOutput { txid: string; vout: number; @@ -881,41 +1196,49 @@ export interface UnblindIssuanceOutput { tokenamount?: bigint; } +/** */ export interface UnblindRawTransactionResponse { hex: string; outputs?: UnblindOutput[]; issuanceOutputs?: UnblindIssuanceOutput[]; } +/** @property {string} hex - base58 target byte hex */ export interface EncodeBase58Request { hex: string; hasChecksum?: boolean; } +/** @property {string} data - encoded data */ export interface EncodeBase58Response { data: string; } +/** @property {string} signature - signature */ export interface EncodeSignatureByDerRequest { signature: string; sighashType: string; sighashAnyoneCanPay?: boolean; } +/** */ export interface EncodeSignatureByDerResponse { signature: string; } +/** */ export interface InnerErrorResponse { code: number; type: string; message: string; } +/** */ export interface ErrorResponse { error: InnerErrorResponse; } +/** @property {string} scriptSigTemplate? - ScriptSig template is for scriptHash calculation fee. */ export interface SelectUtxoData { txid: string; vout: number; @@ -930,6 +1253,7 @@ export interface SelectUtxoData { scriptSigTemplate?: string; } +/** @property {string} tx - transaction hex */ export interface EstimateFeeRequest { selectUtxos?: SelectUtxoData[]; feeRate: number; @@ -941,12 +1265,20 @@ export interface EstimateFeeRequest { minimumBits?: number; } +/** + * @property {bigint} feeAmount - tx fee amount. (txoutFeeAmount + utxoFeeAmount) + * @property {bigint} txFeeAmount? - (deprecated: rename to txoutFeeAmount) + * @property {bigint} txoutFeeAmount? - fee of tx output & base area. + * @property {bigint} utxoFeeAmount? - fee of tx inputs utxo. + */ export interface EstimateFeeResponse { feeAmount: bigint; txFeeAmount?: bigint; + txoutFeeAmount?: bigint; utxoFeeAmount?: bigint; } +/** @property {string} scriptSigTemplate? - ScriptSig template is for scriptHash calculation fee. */ export interface FundUtxoJsonData { txid: string; vout: number; @@ -957,6 +1289,7 @@ export interface FundUtxoJsonData { scriptSigTemplate?: string; } +/** @property {string} scriptSigTemplate? - ScriptSig template is for scriptHash calculation fee. */ export interface FundSelectUtxoData { txid: string; vout: number; @@ -973,12 +1306,17 @@ export interface FundSelectUtxoData { scriptSigTemplate?: string; } +/** + * @property {bigint | number} amount - Amount more than the specified amount is set in txout. default is 0 (disable). + * @property {string} reserveAddress - This address use when append TxOut. Also serves as a change address. (This field is available only bitcoin.) + */ export interface FundAmountMapData { asset: string; amount: bigint | number; reserveAddress: string; } +/** @property {bigint | number} knapsackMinChange? - knapsack logic's threshold. Recommended value is 1. (knapsack minimum change amount.) */ export interface FundFeeInfomation { feeRate: number; longTermFeeRate?: number; @@ -990,6 +1328,11 @@ export interface FundFeeInfomation { minimumBits?: number; } +/** + * @property {string} tx - transaction hex + * @property {bigint | number} targetAmount? - Amount more than the specified amount is set in txout. default is 0 (disable). (This field is available only bitcoin.) + * @property {string} reserveAddress? - This address use when append TxOut. Also serves as a change address. (This field is available only bitcoin.) + */ export interface FundRawTransactionRequest { utxos: FundUtxoJsonData[]; selectUtxos?: FundSelectUtxoData[]; @@ -1002,12 +1345,14 @@ export interface FundRawTransactionRequest { feeInfo?: FundFeeInfomation; } +/** */ export interface FundRawTransactionResponse { hex: string; usedAddresses?: string[]; feeAmount?: bigint; } +/** @property {string} redeemScript - redeem script on multisig */ export interface GetAddressesFromMultisigRequest { isElements?: boolean; redeemScript: string; @@ -1015,17 +1360,20 @@ export interface GetAddressesFromMultisigRequest { hashType?: string; } +/** */ export interface GetAddressesFromMultisigResponse { addresses: string[]; pubkeys: string[]; requireNum: number; } +/** @property {string} address - address text */ export interface GetAddressInfoRequest { address: string; isElements?: boolean; } +/** @property {string} hash? - pubkey-hash or script-hash. p2wsh:32byte, other:20byte */ export interface GetAddressInfoResponse { lockingScript: string; network: string; @@ -1034,6 +1382,7 @@ export interface GetAddressInfoResponse { hash?: string; } +/** */ export interface GetCommitmentRequest { amount: bigint | number; asset: string; @@ -1041,33 +1390,40 @@ export interface GetCommitmentRequest { blindFactor: string; } +/** */ export interface GetCommitmentResponse { assetCommitment: string; amountCommitment: string; } +/** */ export interface GetCompressedPubkeyRequest { pubkey: string; } +/** */ export interface GetCompressedPubkeyResponse { pubkey: string; } +/** @property {string} address? - use if empty locking script. */ export interface GetDefaultBlindingKeyRequest { masterBlindingKey: string; lockingScript?: string; address?: string; } +/** */ export interface GetDefaultBlindingKeyResponse { blindingKey: string; } +/** */ export interface GetExtkeyInfoRequest { extkey: string; } +/** */ export interface GetExtkeyInfoResponse { network: string; version: string; @@ -1077,24 +1433,29 @@ export interface GetExtkeyInfoResponse { chainCode: string; } +/** */ export interface GetIssuanceBlindingKeyRequest { masterBlindingKey: string; txid: string; vout: number; } +/** */ export interface GetIssuanceBlindingKeyResponse { blindingKey: string; } +/** */ export interface GetMnemonicWordlistRequest { language: string; } +/** */ export interface GetMnemonicWordlistResponse { wordlist: string[]; } +/** */ export interface GetPrivkeyFromExtkeyRequest { extkey: string; network: string; @@ -1102,63 +1463,76 @@ export interface GetPrivkeyFromExtkeyRequest { isCompressed?: boolean; } +/** */ export interface GetPrivkeyFromExtkeyResponse { privkey: string; } +/** @property {string} wif - Wallet Import Format */ export interface GetPrivkeyFromWifRequest { wif: string; } +/** @property {string} hex - privkey hex. */ export interface GetPrivkeyFromWifResponse { hex: string; network: string; isCompressed: boolean; } +/** @property {string} hex - privkey hex. */ export interface GetPrivkeyWifRequest { hex: string; network: string; isCompressed: boolean; } +/** @property {string} wif - Wallet Import Format */ export interface GetPrivkeyWifResponse { wif: string; } +/** */ export interface GetPubkeyFromExtkeyRequest { extkey: string; network: string; } +/** */ export interface GetPubkeyFromExtkeyResponse { pubkey: string; } +/** */ export interface GetPubkeyFromPrivkeyRequest { privkey: string; isCompressed?: boolean; } +/** */ export interface GetPubkeyFromPrivkeyResponse { pubkey: string; } +/** */ export interface GetWitnessStackNumTxInRequest { txid: string; vout: number; } +/** @property {string} tx - transaction hex */ export interface GetWitnessStackNumRequest { tx: string; isElements?: boolean; txin: GetWitnessStackNumTxInRequest; } +/** */ export interface GetWitnessStackNumResponse { count: number; } +/** */ export interface CreateMultisigRequest { nrequired: number; keys: string[]; @@ -1167,12 +1541,17 @@ export interface CreateMultisigRequest { hashType: string; } +/** + * @property {string} redeemScript? - (required for P2SH or P2SH-P2WSH) redeem script for unlocking script + * @property {string} witnessScript? - (required for P2WSH or P2SH-P2WSH) witness script for witness stack + */ export interface CreateMultisigResponse { address: string; redeemScript?: string; witnessScript?: string; } +/** @property {string} descriptor - output descriptor */ export interface ParseDescriptorRequest { isElements?: boolean; descriptor: string; @@ -1180,11 +1559,13 @@ export interface ParseDescriptorRequest { bip32DerivationPath?: string; } +/** */ export interface DescriptorKeyJson { keyType: string; key: string; } +/** */ export interface DescriptorScriptJson { depth: number; lockingScript: string; @@ -1197,6 +1578,7 @@ export interface DescriptorScriptJson { reqNum?: number; } +/** */ export interface ParseDescriptorResponse { type: string; address?: string; @@ -1207,14 +1589,17 @@ export interface ParseDescriptorResponse { scripts?: DescriptorScriptJson[]; } +/** @property {string} script - script hex. */ export interface ParseScriptRequest { script: string; } +/** */ export interface ParseScriptResponse { scriptItems: string[]; } +/** */ export interface UtxoJsonData { txid: string; vout: number; @@ -1223,11 +1608,13 @@ export interface UtxoJsonData { descriptor?: string; } +/** */ export interface TargetAmountMapData { asset: string; amount: bigint; } +/** @property {number} knapsackMinChange? - knapsack logic's threshold. Recommended value is 1. (knapsack minimum change amount.) */ export interface CoinSelectionFeeInfomationField { txFeeAmount?: bigint | number; feeRate?: number; @@ -1238,6 +1625,7 @@ export interface CoinSelectionFeeInfomationField { minimumBits?: number; } +/** @property {bigint | number} targetAmount? - Amount more than the specified amount is set in txout. default is 0 (disable). (This field is available only bitcoin.) */ export interface SelectUtxosRequest { utxos: UtxoJsonData[]; targetAmount?: bigint | number; @@ -1246,6 +1634,7 @@ export interface SelectUtxosRequest { feeInfo?: CoinSelectionFeeInfomationField; } +/** */ export interface UtxoJsonData { txid: string; vout: number; @@ -1254,11 +1643,13 @@ export interface UtxoJsonData { descriptor?: string; } +/** */ export interface TargetAmountMapData { asset: string; amount: bigint; } +/** */ export interface SelectUtxosResponse { utxos: UtxoJsonData[]; selectedAmount?: bigint; @@ -1267,12 +1658,14 @@ export interface SelectUtxosResponse { utxoFeeAmount: bigint; } +/** */ export interface SerializeLedgerFormatTxOut { index: number; asset: string; amount: bigint | number; } +/** @property {string} tx - transaction hex */ export interface SerializeLedgerFormatRequest { tx: string; txouts?: SerializeLedgerFormatTxOut[]; @@ -1280,16 +1673,19 @@ export interface SerializeLedgerFormatRequest { isAuthorization: boolean; } +/** */ export interface SerializeLedgerFormatResponse { serialize: string; sha256: string; } +/** */ export interface SignatureHashKeyData { hex: string; type: string; } +/** */ export interface CreateSignatureHashTxInRequest { txid: string; vout: number; @@ -1300,20 +1696,24 @@ export interface CreateSignatureHashTxInRequest { sighashAnyoneCanPay?: boolean; } +/** @property {string} tx - transaction hex */ export interface CreateSignatureHashRequest { tx: string; txin: CreateSignatureHashTxInRequest; } +/** */ export interface CreateSignatureHashResponse { sighash: string; } +/** */ export interface ElementsSignatureHashKeyData { hex: string; type: string; } +/** */ export interface CreateElementsSignatureHashTxIn { txid: string; vout: number; @@ -1325,15 +1725,21 @@ export interface CreateElementsSignatureHashTxIn { sighashAnyoneCanPay?: boolean; } +/** @property {string} tx - transaction hex */ export interface CreateElementsSignatureHashRequest { tx: string; txin: CreateElementsSignatureHashTxIn; } +/** */ export interface CreateElementsSignatureHashResponse { sighash: string; } +/** + * @property {string} privkey - private key. hex or wif format. + * @property {string} pubkey? - public key. if empty, generate from privkey. + */ export interface SignWithPrivkeyTxInRequest { txid: string; vout: number; @@ -1347,33 +1753,42 @@ export interface SignWithPrivkeyTxInRequest { isGrindR?: boolean; } +/** + * Add signatures to pubkey hash input + * @property {string} tx - transaction hex + */ export interface SignWithPrivkeyRequest { isElements?: boolean; tx: string; txin?: SignWithPrivkeyTxInRequest; } +/** */ export interface SignWithPrivkeyResponse { hex: string; } +/** */ export interface GetSupportedFunctionResponse { bitcoin: boolean; elements: boolean; } +/** */ export interface TxInRequest { txid: string; vout: number; sequence?: number; } +/** */ export interface TxOutRequest { address: string; amount: bigint | number; directLockingScript?: string; } +/** */ export interface CreateRawTransactionRequest { version?: number; locktime?: number; @@ -1381,10 +1796,12 @@ export interface CreateRawTransactionRequest { txouts?: TxOutRequest[]; } +/** */ export interface CreateRawTransactionResponse { hex: string; } +/** */ export interface UpdateTxOutAmountData { amount: bigint | number; index?: number; @@ -1392,16 +1809,19 @@ export interface UpdateTxOutAmountData { directLockingScript?: string; } +/** @property {string} tx - transaction hex */ export interface UpdateTxOutAmountRequest { tx: string; isElements?: boolean; txouts?: UpdateTxOutAmountData[]; } +/** */ export interface UpdateTxOutAmountResponse { hex: string; } +/** */ export interface WitnessStackData { index: number; hex: string; @@ -1411,22 +1831,26 @@ export interface WitnessStackData { sighashAnyoneCanPay?: boolean; } +/** */ export interface UpdateWitnessStackTxInRequest { txid: string; vout: number; witnessStack: WitnessStackData; } +/** @property {string} tx - transaction hex */ export interface UpdateWitnessStackRequest { tx: string; isElements?: boolean; txin?: UpdateWitnessStackTxInRequest; } +/** */ export interface UpdateWitnessStackResponse { hex?: string; } +/** */ export interface VerifyignTxInUtxoData { txid: string; vout: number; @@ -1436,23 +1860,30 @@ export interface VerifyignTxInUtxoData { confidentialValueCommitment?: string; } +/** + * @property {string} tx - transaction hex + * @property {boolean} isElements? - elements transaction flag. + */ export interface VerifySignRequest { tx: string; isElements?: boolean; txins: VerifyignTxInUtxoData[]; } +/** */ export interface FailSignTxIn { txid: string; vout: number; reason: string; } +/** */ export interface VerifySignResponse { success: boolean; failTxins?: FailSignTxIn[]; } +/** */ export interface VerifySignatureTxInRequest { txid: string; vout: number; @@ -1466,157 +1897,463 @@ export interface VerifySignatureTxInRequest { confidentialValueCommitment?: string; } +/** + * @property {string} tx - transaction hex + * @property {boolean} isElements? - elements transaction flag. + */ export interface VerifySignatureRequest { tx: string; isElements?: boolean; txin: VerifySignatureTxInRequest; } +/** */ export interface VerifySignatureResponse { success: boolean; } +/** + * Add multisig signatures to the transaction. + * @param {AddMultisigSignRequest} - request data. + * @return {AddMultisigSignResponse} - response data. + */ export function AddMultisigSign(jsonObject: AddMultisigSignRequest): AddMultisigSignResponse; +/** + * Add a signature and pubkey to the transaction. + * @param {AddPubkeyHashSignRequest} - request data. + * @return {AddPubkeyHashSignResponse} - response data. + */ export function AddPubkeyHashSign(jsonObject: AddPubkeyHashSignRequest): AddPubkeyHashSignResponse; +/** + * Add tx inputs and tx outputs to the transaction. + * @param {AddRawTransactionRequest} - request data. + * @return {AddRawTransactionResponse} - response data. + */ export function AddRawTransaction(jsonObject: AddRawTransactionRequest): AddRawTransactionResponse; +/** + * Add a signature and redeem script to the transaction. + * @param {AddScriptHashSignRequest} - request data. + * @return {AddScriptHashSignResponse} - response data. + */ export function AddScriptHashSign(jsonObject: AddScriptHashSignRequest): AddScriptHashSignResponse; +/** + * Add a sign data to the transaction. + * @param {AddSignRequest} - request data. + * @return {AddSignResponse} - response data. + */ export function AddSign(jsonObject: AddSignRequest): AddSignResponse; +/** + * Get output descriptor added checksum. + * @param {AppendDescriptorChecksumRequest} - request data. + * @return {AppendDescriptorChecksumResponse} - response data. + */ export function AppendDescriptorChecksum(jsonObject: AppendDescriptorChecksumRequest): AppendDescriptorChecksumResponse; +/** + * blind the transaction. + * @param {BlindRawTransactionRequest} - request data. + * @return {BlindRawTransactionResponse} - response data. + */ export function BlindRawTransaction(jsonObject: BlindRawTransactionRequest): BlindRawTransactionResponse; +/** + * calculate ec signature. + * @param {CalculateEcSignatureRequest} - request data. + * @return {CalculateEcSignatureResponse} - response data. + */ export function CalculateEcSignature(jsonObject: CalculateEcSignatureRequest): CalculateEcSignatureResponse; +/** + * Encode/Decode AES. + * @param {ConvertAesRequest} - request data. + * @return {ConvertAesResponse} - response data. + */ export function ConvertAes(jsonObject: ConvertAesRequest): ConvertAesResponse; +/** + * @param {ConvertEntropyToMnemonicRequest} - request data. + * @return {ConvertEntropyToMnemonicResponse} - response data. + */ export function ConvertEntropyToMnemonic(jsonObject: ConvertEntropyToMnemonicRequest): ConvertEntropyToMnemonicResponse; +/** + * @param {ConvertMnemonicToSeedRequest} - request data. + * @return {ConvertMnemonicToSeedResponse} - response data. + */ export function ConvertMnemonicToSeed(jsonObject: ConvertMnemonicToSeedRequest): ConvertMnemonicToSeedResponse; +/** + * @param {CreateAddressRequest} - request data. + * @return {CreateAddressResponse} - response data. + */ export function CreateAddress(jsonObject: CreateAddressRequest): CreateAddressResponse; +/** + * @param {CreateDescriptorRequest} - request data. + * @return {CreateDescriptorResponse} - response data. + */ export function CreateDescriptor(jsonObject: CreateDescriptorRequest): CreateDescriptorResponse; +/** + * @param {CreateExtkeyRequest} - request data. + * @return {CreateExtkeyResponse} - response data. + */ export function CreateExtkey(jsonObject: CreateExtkeyRequest): CreateExtkeyResponse; +/** + * @param {CreateExtkeyFromParentRequest} - request data. + * @return {CreateExtkeyFromParentResponse} - response data. + */ export function CreateExtkeyFromParent(jsonObject: CreateExtkeyFromParentRequest): CreateExtkeyFromParentResponse; +/** + * @param {CreateExtkeyFromParentKeyRequest} - request data. + * @return {CreateExtkeyFromParentKeyResponse} - response data. + */ export function CreateExtkeyFromParentKey(jsonObject: CreateExtkeyFromParentKeyRequest): CreateExtkeyFromParentKeyResponse; +/** + * @param {CreateExtkeyFromParentPathRequest} - request data. + * @return {CreateExtkeyFromParentPathResponse} - response data. + */ export function CreateExtkeyFromParentPath(jsonObject: CreateExtkeyFromParentPathRequest): CreateExtkeyFromParentPathResponse; +/** + * @param {CreateExtkeyFromSeedRequest} - request data. + * @return {CreateExtkeyFromSeedResponse} - response data. + */ export function CreateExtkeyFromSeed(jsonObject: CreateExtkeyFromSeedRequest): CreateExtkeyFromSeedResponse; +/** + * @param {CreateExtPubkeyRequest} - request data. + * @return {CreateExtPubkeyResponse} - response data. + */ export function CreateExtPubkey(jsonObject: CreateExtPubkeyRequest): CreateExtPubkeyResponse; +/** + * @param {CreateKeyPairRequest} - request data. + * @return {CreateKeyPairResponse} - response data. + */ export function CreateKeyPair(jsonObject: CreateKeyPairRequest): CreateKeyPairResponse; +/** + * @param {CreateMultisigScriptSigRequest} - request data. + * @return {CreateMultisigScriptSigResponse} - response data. + */ export function CreateMultisigScriptSig(jsonObject: CreateMultisigScriptSigRequest): CreateMultisigScriptSigResponse; +/** + * @param {CreateScriptRequest} - request data. + * @return {CreateScriptResponse} - response data. + */ export function CreateScript(jsonObject: CreateScriptRequest): CreateScriptResponse; +/** + * @param {DecodeBase58Request} - request data. + * @return {DecodeBase58Response} - response data. + */ export function DecodeBase58(jsonObject: DecodeBase58Request): DecodeBase58Response; +/** + * @param {DecodeDerSignatureToRawRequest} - request data. + * @return {DecodeDerSignatureToRawResponse} - response data. + */ export function DecodeDerSignatureToRaw(jsonObject: DecodeDerSignatureToRawRequest): DecodeDerSignatureToRawResponse; +/** + * @param {DecodeRawTransactionRequest} - request data. + * @return {DecodeRawTransactionResponse} - response data. + */ export function DecodeRawTransaction(jsonObject: DecodeRawTransactionRequest): DecodeRawTransactionResponse; +/** + * @param {ElementsAddRawTransactionRequest} - request data. + * @return {ElementsAddRawTransactionResponse} - response data. + */ export function ElementsAddRawTransaction(jsonObject: ElementsAddRawTransactionRequest): ElementsAddRawTransactionResponse; +/** + * @param {CreateDestroyAmountRequest} - request data. + * @return {CreateDestroyAmountResponse} - response data. + */ export function CreateDestroyAmount(jsonObject: CreateDestroyAmountRequest): CreateDestroyAmountResponse; +/** + * @param {CreatePegInAddressRequest} - request data. + * @return {CreatePegInAddressResponse} - response data. + */ export function CreatePegInAddress(jsonObject: CreatePegInAddressRequest): CreatePegInAddressResponse; +/** + * @param {CreateRawPeginRequest} - request data. + * @return {CreateRawPeginResponse} - response data. + */ export function CreateRawPegin(jsonObject: CreateRawPeginRequest): CreateRawPeginResponse; +/** + * @param {CreateRawPegoutRequest} - request data. + * @return {CreateRawPegoutResponse} - response data. + */ export function CreateRawPegout(jsonObject: CreateRawPegoutRequest): CreateRawPegoutResponse; +/** + * @param {ElementsCreateRawTransactionRequest} - request data. + * @return {ElementsCreateRawTransactionResponse} - response data. + */ export function ElementsCreateRawTransaction(jsonObject: ElementsCreateRawTransactionRequest): ElementsCreateRawTransactionResponse; +/** + * @param {ElementsDecodeRawTransactionRequest} - request data. + * @return {ElementsDecodeRawTransactionResponse} - response data. + */ export function ElementsDecodeRawTransaction(jsonObject: ElementsDecodeRawTransactionRequest): ElementsDecodeRawTransactionResponse; +/** + * @param {GetConfidentialAddressRequest} - request data. + * @return {GetConfidentialAddressResponse} - response data. + */ export function GetConfidentialAddress(jsonObject: GetConfidentialAddressRequest): GetConfidentialAddressResponse; +/** + * @param {GetUnblindedAddressRequest} - request data. + * @return {GetUnblindedAddressResponse} - response data. + */ export function GetUnblindedAddress(jsonObject: GetUnblindedAddressRequest): GetUnblindedAddressResponse; +/** + * @param {SetRawIssueAssetRequest} - request data. + * @return {SetRawIssueAssetResponse} - response data. + */ export function SetRawIssueAsset(jsonObject: SetRawIssueAssetRequest): SetRawIssueAssetResponse; +/** + * @param {SetRawReissueAssetRequest} - request data. + * @return {SetRawReissueAssetResponse} - response data. + */ export function SetRawReissueAsset(jsonObject: SetRawReissueAssetRequest): SetRawReissueAssetResponse; +/** + * @param {UnblindRawTransactionRequest} - request data. + * @return {UnblindRawTransactionResponse} - response data. + */ export function UnblindRawTransaction(jsonObject: UnblindRawTransactionRequest): UnblindRawTransactionResponse; +/** + * @param {EncodeBase58Request} - request data. + * @return {EncodeBase58Response} - response data. + */ export function EncodeBase58(jsonObject: EncodeBase58Request): EncodeBase58Response; +/** + * @param {EncodeSignatureByDerRequest} - request data. + * @return {EncodeSignatureByDerResponse} - response data. + */ export function EncodeSignatureByDer(jsonObject: EncodeSignatureByDerRequest): EncodeSignatureByDerResponse; +/** + * @param {EstimateFeeRequest} - request data. + * @return {EstimateFeeResponse} - response data. + */ export function EstimateFee(jsonObject: EstimateFeeRequest): EstimateFeeResponse; +/** + * @param {FundRawTransactionRequest} - request data. + * @return {FundRawTransactionResponse} - response data. + */ export function FundRawTransaction(jsonObject: FundRawTransactionRequest): FundRawTransactionResponse; +/** + * @param {GetAddressesFromMultisigRequest} - request data. + * @return {GetAddressesFromMultisigResponse} - response data. + */ export function GetAddressesFromMultisig(jsonObject: GetAddressesFromMultisigRequest): GetAddressesFromMultisigResponse; +/** + * @param {GetAddressInfoRequest} - request data. + * @return {GetAddressInfoResponse} - response data. + */ export function GetAddressInfo(jsonObject: GetAddressInfoRequest): GetAddressInfoResponse; +/** + * @param {GetCommitmentRequest} - request data. + * @return {GetCommitmentResponse} - response data. + */ export function GetCommitment(jsonObject: GetCommitmentRequest): GetCommitmentResponse; +/** + * @param {GetCompressedPubkeyRequest} - request data. + * @return {GetCompressedPubkeyResponse} - response data. + */ export function GetCompressedPubkey(jsonObject: GetCompressedPubkeyRequest): GetCompressedPubkeyResponse; +/** + * @param {GetDefaultBlindingKeyRequest} - request data. + * @return {GetDefaultBlindingKeyResponse} - response data. + */ export function GetDefaultBlindingKey(jsonObject: GetDefaultBlindingKeyRequest): GetDefaultBlindingKeyResponse; +/** + * @param {GetExtkeyInfoRequest} - request data. + * @return {GetExtkeyInfoResponse} - response data. + */ export function GetExtkeyInfo(jsonObject: GetExtkeyInfoRequest): GetExtkeyInfoResponse; +/** + * @param {GetIssuanceBlindingKeyRequest} - request data. + * @return {GetIssuanceBlindingKeyResponse} - response data. + */ export function GetIssuanceBlindingKey(jsonObject: GetIssuanceBlindingKeyRequest): GetIssuanceBlindingKeyResponse; +/** + * @param {GetMnemonicWordlistRequest} - request data. + * @return {GetMnemonicWordlistResponse} - response data. + */ export function GetMnemonicWordlist(jsonObject: GetMnemonicWordlistRequest): GetMnemonicWordlistResponse; +/** + * @param {GetPrivkeyFromExtkeyRequest} - request data. + * @return {GetPrivkeyFromExtkeyResponse} - response data. + */ export function GetPrivkeyFromExtkey(jsonObject: GetPrivkeyFromExtkeyRequest): GetPrivkeyFromExtkeyResponse; +/** + * @param {GetPrivkeyFromWifRequest} - request data. + * @return {GetPrivkeyFromWifResponse} - response data. + */ export function GetPrivkeyFromWif(jsonObject: GetPrivkeyFromWifRequest): GetPrivkeyFromWifResponse; +/** + * @param {GetPrivkeyWifRequest} - request data. + * @return {GetPrivkeyWifResponse} - response data. + */ export function GetPrivkeyWif(jsonObject: GetPrivkeyWifRequest): GetPrivkeyWifResponse; +/** + * @param {GetPubkeyFromExtkeyRequest} - request data. + * @return {GetPubkeyFromExtkeyResponse} - response data. + */ export function GetPubkeyFromExtkey(jsonObject: GetPubkeyFromExtkeyRequest): GetPubkeyFromExtkeyResponse; +/** + * @param {GetPubkeyFromPrivkeyRequest} - request data. + * @return {GetPubkeyFromPrivkeyResponse} - response data. + */ export function GetPubkeyFromPrivkey(jsonObject: GetPubkeyFromPrivkeyRequest): GetPubkeyFromPrivkeyResponse; +/** + * @param {GetWitnessStackNumRequest} - request data. + * @return {GetWitnessStackNumResponse} - response data. + */ export function GetWitnessStackNum(jsonObject: GetWitnessStackNumRequest): GetWitnessStackNumResponse; +/** + * @param {CreateMultisigRequest} - request data. + * @return {CreateMultisigResponse} - response data. + */ export function CreateMultisig(jsonObject: CreateMultisigRequest): CreateMultisigResponse; +/** + * @param {ParseDescriptorRequest} - request data. + * @return {ParseDescriptorResponse} - response data. + */ export function ParseDescriptor(jsonObject: ParseDescriptorRequest): ParseDescriptorResponse; +/** + * @param {ParseScriptRequest} - request data. + * @return {ParseScriptResponse} - response data. + */ export function ParseScript(jsonObject: ParseScriptRequest): ParseScriptResponse; +/** + * @param {SelectUtxosRequest} - request data. + * @return {SelectUtxosResponse} - response data. + */ export function SelectUtxos(jsonObject: SelectUtxosRequest): SelectUtxosResponse; +/** + * @param {SerializeLedgerFormatRequest} - request data. + * @return {SerializeLedgerFormatResponse} - response data. + */ export function SerializeLedgerFormat(jsonObject: SerializeLedgerFormatRequest): SerializeLedgerFormatResponse; +/** + * @param {CreateSignatureHashRequest} - request data. + * @return {CreateSignatureHashResponse} - response data. + */ export function CreateSignatureHash(jsonObject: CreateSignatureHashRequest): CreateSignatureHashResponse; +/** + * @param {CreateElementsSignatureHashRequest} - request data. + * @return {CreateElementsSignatureHashResponse} - response data. + */ export function CreateElementsSignatureHash(jsonObject: CreateElementsSignatureHashRequest): CreateElementsSignatureHashResponse; +/** + * @param {SignWithPrivkeyRequest} - request data. + * @return {SignWithPrivkeyResponse} - response data. + */ export function SignWithPrivkey(jsonObject: SignWithPrivkeyRequest): SignWithPrivkeyResponse; +/** @return {GetSupportedFunctionResponse} - response data. */ export function GetSupportedFunction(): GetSupportedFunctionResponse; +/** + * @param {CreateRawTransactionRequest} - request data. + * @return {CreateRawTransactionResponse} - response data. + */ export function CreateRawTransaction(jsonObject: CreateRawTransactionRequest): CreateRawTransactionResponse; +/** + * @param {UpdateTxOutAmountRequest} - request data. + * @return {UpdateTxOutAmountResponse} - response data. + */ export function UpdateTxOutAmount(jsonObject: UpdateTxOutAmountRequest): UpdateTxOutAmountResponse; +/** + * @param {UpdateWitnessStackRequest} - request data. + * @return {UpdateWitnessStackResponse} - response data. + */ export function UpdateWitnessStack(jsonObject: UpdateWitnessStackRequest): UpdateWitnessStackResponse; +/** + * @param {VerifySignRequest} - request data. + * @return {VerifySignResponse} - response data. + */ export function VerifySign(jsonObject: VerifySignRequest): VerifySignResponse; +/** + * @param {VerifySignatureRequest} - request data. + * @return {VerifySignatureResponse} - response data. + */ export function VerifySignature(jsonObject: VerifySignatureRequest): VerifySignatureResponse; +/** error class. */ export class CfdError extends Error { - constructor(message: string, errorInformation: InnerErrorResponse, cause: Error); - toString(): string; - getErrorInformation(): InnerErrorResponse; - getCause(): Error; + /** + * constructor. + * @param {string} message - Error message. + * @param {InnerErrorResponse} errorInformation - Error information data. + * @param {Error} cause - Cause of the error. + */ + constructor(message: string, errorInformation: InnerErrorResponse, cause: Error); + /** + * get error string. + * @return {string} - string data. + */ + toString(): string; + /** + * get error information. + * @return {InnerErrorResponse} - InnerErrorResponse data. + */ + getErrorInformation(): InnerErrorResponse; + /** + * get error cause. + * @return {Error} - Error data. + */ + getCause(): Error; } diff --git a/package-lock.json b/package-lock.json index c2c383ad..f55d50e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "cfd-js", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.4" } }, "@babel/core": { @@ -36,32 +36,6 @@ "source-map": "^0.5.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -189,9 +163,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", - "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==" + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==" }, "@babel/helpers": { "version": "7.10.4", @@ -205,20 +179,13 @@ } }, "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" - }, - "dependencies": { - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - } } }, "@babel/parser": { @@ -335,34 +302,6 @@ "@babel/code-frame": "^7.10.4", "@babel/parser": "^7.10.4", "@babel/types": "^7.10.4" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - } } }, "@babel/traverse": { @@ -382,31 +321,11 @@ "lodash": "^4.17.19" }, "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } } } }, @@ -419,14 +338,6 @@ "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - } } }, "@bcoe/v8-coverage": { @@ -644,12 +555,6 @@ "path-is-absolute": "^1.0.0" } }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -802,12 +707,6 @@ "path-is-absolute": "^1.0.0" } }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -842,12 +741,6 @@ "source-map": "^0.6.0" }, "dependencies": { - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -879,14 +772,6 @@ "jest-haste-map": "^25.5.1", "jest-runner": "^25.5.4", "jest-runtime": "^25.5.4" - }, - "dependencies": { - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - } } }, "@jest/transform": { @@ -948,12 +833,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1065,9 +944,9 @@ } }, "@sindresorhus/is": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.0.tgz", - "integrity": "sha512-lXKXfypKo644k4Da4yXkPCrwcvn6SlUW2X2zFbuflKHNjf0w9htru01bo26uMhleMXsDmnZ12eJLdrAZa9MANg==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-2.1.1.tgz", + "integrity": "sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg==" }, "@sinonjs/commons": { "version": "1.8.1", @@ -1396,9 +1275,9 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", "dev": true }, "acorn-globals": { @@ -1438,18 +1317,18 @@ "dev": true }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "requires": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "ajv": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", - "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1686,9 +1565,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" }, "babel-jest": { "version": "25.5.1", @@ -1741,12 +1620,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1913,19 +1786,19 @@ } }, "bl": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.0.tgz", - "integrity": "sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==", - "dev": true, + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "requires": { - "readable-stream": "^3.0.1" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" }, "dependencies": { "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -1935,14 +1808,12 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "requires": { "safe-buffer": "~5.2.0" } @@ -2205,9 +2076,9 @@ } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, "cliui": { @@ -2752,21 +2623,21 @@ } }, "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, "es-to-primitive": { @@ -2898,15 +2769,6 @@ "eslint-visitor-keys": "^1.1.0" } }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -2935,15 +2797,9 @@ } }, "strip-json-comments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", - "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", - "dev": true - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true } } @@ -2955,9 +2811,9 @@ "dev": true }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -2974,9 +2830,9 @@ } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, "espree": { @@ -2997,18 +2853,18 @@ "dev": true }, "esquery": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.2.0.tgz", - "integrity": "sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^5.0.0" + "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.0.0.tgz", - "integrity": "sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true } } @@ -3187,9 +3043,9 @@ }, "dependencies": { "type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", - "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", "dev": true } } @@ -3302,9 +3158,9 @@ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "3.2.4", @@ -3555,9 +3411,9 @@ "dev": true }, "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "requires": { "pump": "^3.0.0" } @@ -3635,10 +3491,21 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } }, "globby": { "version": "10.0.2", @@ -3690,12 +3557,19 @@ "responselike": "^2.0.0", "to-readable-stream": "^2.0.0", "type-fest": "^0.10.0" + }, + "dependencies": { + "type-fest": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.10.0.tgz", + "integrity": "sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==" + } } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "graceful-readlink": { "version": "1.0.1", @@ -3715,11 +3589,11 @@ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "requires": { - "ajv": "^6.5.5", + "ajv": "^6.12.3", "har-schema": "^2.0.0" } }, @@ -3954,21 +3828,21 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "inquirer": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", - "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", - "chalk": "^3.0.0", + "chalk": "^4.1.0", "cli-cursor": "^3.1.0", - "cli-width": "^2.0.0", + "cli-width": "^3.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "mute-stream": "0.0.8", "run-async": "^2.4.0", - "rxjs": "^6.5.3", + "rxjs": "^6.6.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6" @@ -3991,9 +3865,9 @@ } }, "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -4116,9 +3990,9 @@ "dev": true }, "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" }, "is-ci": { "version": "2.0.0", @@ -4253,18 +4127,12 @@ "isobject": "^3.0.1" } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "requires": { - "has": "^1.0.3" + "has-symbols": "^1.0.1" } }, "is-relative": { @@ -4487,12 +4355,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4763,12 +4625,6 @@ "path-is-absolute": "^1.0.0" } }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4987,12 +4843,6 @@ "which": "^2.0.2" }, "dependencies": { - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -5206,12 +5056,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5302,27 +5146,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, "supports-color": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", @@ -5407,12 +5236,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5546,12 +5369,6 @@ "path-is-absolute": "^1.0.0" } }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5644,14 +5461,6 @@ "dev": true, "requires": { "graceful-fs": "^4.2.4" - }, - "dependencies": { - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - } } }, "jest-snapshot": { @@ -5712,12 +5521,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5789,12 +5592,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5980,13 +5777,12 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -6061,6 +5857,11 @@ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, + "json-parse-even-better-errors": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", + "integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==" + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -6109,6 +5910,43 @@ "hyperquest": "~2.1.3", "json-stringify-safe": "~5.0.1", "xtend": "~4.0.1" + }, + "dependencies": { + "bl": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-3.0.1.tgz", + "integrity": "sha512-jrCW5ZhfQ/Vt07WX1Ngs+yn9BDqPL/gw28S7s9H6QK/gupnizNzJAss5akW20ISgOrbLTlXOOCTJeNUQqruAWQ==", + "dev": true, + "requires": { + "readable-stream": "^3.0.1" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + } } }, "jsprim": { @@ -6123,9 +5961,9 @@ } }, "keyv": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.0.tgz", - "integrity": "sha512-U7ioE8AimvRVLfw4LffyOIRhL2xVgmE8T22L6i0BucSnBUyv4w+I7VN/zVZwRKHOI6ZRUcdMdWHQ8KSUvGpEog==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.1.tgz", + "integrity": "sha512-xz6Jv6oNkbhrFCvCP7HQa8AaII8y8LRpoSm661NOKLr4uHuBwhX4epXrPQgF3+xdJnN4Esm5X0xwY4bOlALOtw==", "requires": { "json-buffer": "3.0.1" } @@ -6184,6 +6022,17 @@ "parse-json": "^4.0.0", "pify": "^3.0.0", "strip-bom": "^3.0.0" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + } } }, "locate-path": { @@ -6321,13 +6170,6 @@ "trim-newlines": "^3.0.0", "type-fest": "^0.13.1", "yargs-parser": "^18.1.3" - }, - "dependencies": { - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==" - } } }, "merge-stream": { @@ -6351,16 +6193,16 @@ } }, "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" }, "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "requires": { - "mime-db": "1.43.0" + "mime-db": "1.44.0" } }, "mimic-fn": { @@ -6532,9 +6374,9 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-abi": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.19.0.tgz", - "integrity": "sha512-rpKqVe24p9GvMTgtqUXdLR1WQJBGVlkYPU10qHKv9/1i9V/k04MmFLVK2WcHBf1WKKY+ZsdvARPi8F4tfJ4opA==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.18.0.tgz", + "integrity": "sha512-yi05ZoiuNNEbyT/xXfSySZE+yVnQW6fxPZuFbLyS1s6b5Kw3HzV2PHOM4XR+nsjzkHxByK+2Wg+yCQbe35l8dw==", "requires": { "semver": "^5.4.1" } @@ -6777,6 +6619,26 @@ "read-pkg": "^3.0.0", "shell-quote": "^1.6.1", "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "requires": { + "pify": "^3.0.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + } } }, "npm-run-path": { @@ -6925,9 +6787,9 @@ } }, "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" }, "object-is": { "version": "1.1.2", @@ -6981,9 +6843,9 @@ } }, "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { "mimic-fn": "^2.1.0" @@ -7042,11 +6904,11 @@ "dev": true }, "p-event": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.1.0.tgz", - "integrity": "sha512-4vAd06GCsgflX4wHN1JqrMzBh/8QZ4j+rzp0cd2scXRwuBEv+QR3wrVA5aLhWDLw4y2WgDKvzWF3CCLmVM1UgA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", "requires": { - "p-timeout": "^2.0.1" + "p-timeout": "^3.1.0" } }, "p-finally": { @@ -7079,9 +6941,9 @@ } }, "p-timeout": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", - "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", "requires": { "p-finally": "^1.0.0" } @@ -7101,12 +6963,14 @@ } }, "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", "requires": { + "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" } }, "parse5": { @@ -7581,22 +7445,20 @@ "dev": true }, "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" }, "dependencies": { - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "requires": { - "pify": "^3.0.0" - } + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" } } }, @@ -7610,35 +7472,6 @@ "type-fest": "^0.8.1" }, "dependencies": { - "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" - } - } - }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -7775,9 +7608,9 @@ "dev": true }, "resolve": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", - "integrity": "sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "requires": { "path-parse": "^1.0.6" } @@ -7877,13 +7710,10 @@ "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==" }, "run-async": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", - "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true }, "run-parallel": { "version": "1.1.9", @@ -7902,9 +7732,9 @@ "dev": true }, "rxjs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", - "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", + "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -8372,23 +8202,23 @@ "dev": true }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -8525,38 +8355,18 @@ } }, "string.prototype.trimend": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.0.tgz", - "integrity": "sha512-EEJnGqa/xNfIg05SxiPSqRS7S9qwDhYts1TSLR1BQfYUfPe1stofgGKvwERK9+9yf+PpfBMlpBaCHucXGPQfUA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" } }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, "string.prototype.trimstart": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.0.tgz", - "integrity": "sha512-iCP8g01NFYiiBOnwG1Xc3WZLyoo+RuBymwIlWncShXDDJYWN6DbnM3odslBJdgCdRlq94B5s63NWAZlcn2CS4w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" @@ -8733,13 +8543,18 @@ "path-is-absolute": "^1.0.0" } }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "requires": { - "path-parse": "^1.0.6" + "has": "^1.0.3" } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" } } }, @@ -8780,16 +8595,6 @@ "readable-stream": "^3.1.1" }, "dependencies": { - "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -9035,9 +8840,9 @@ } }, "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, "tsutils": { @@ -9084,9 +8889,9 @@ "dev": true }, "type-fest": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.10.0.tgz", - "integrity": "sha512-EUV9jo4sffrwlg8s0zDhP0T2WD3pru5Xi0+HTE3zTUmBaZNhfkite9PdSJwdXLwPVW0jnAHT56pZHIOYckPEiw==" + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==" }, "typedarray-to-buffer": { "version": "3.1.5", @@ -9267,9 +9072,9 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "dev": true }, "v8-to-istanbul": { diff --git a/package.json b/package.json index dbe77702..0a0cc58a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cfd-js", - "version": "0.1.5", + "version": "0.1.6", "domain": "p2pderivatives", "repository": { "type": "git", @@ -23,8 +23,8 @@ }, "memo": { "abi_url": "https://github.com/lgeiger/node-abi/blob/master/index.js#L51", - "node_version": "-t 9.11.2 -t 11.15.0", - "electron_version": "-t 2.0.0" + "node_version": "-t 9.11.2 -t 11.15.0 -t 13.14.0", + "electron_version": "-t 2.0.0 -t 3.0.0 -t 4.0.4 -t 5.0.0" }, "license": "MIT", "main": "index.js", @@ -33,9 +33,10 @@ "scripts": { "install": "prebuild-install --verbose || run-s install_cmake", "install_cmake": "run-s download_object cmake_install_configure cmake_compile", + "prebuild_all_local": "run-s cmake_clean_all download_object prebuild_all", "prebuild_all": "run-s prebuild_nodejs prebuild_electron", - "prebuild_nodejs": "prebuild --backend cmake-js -t 8.17.0 -t 10.20.1 -t 12.16.3 -t 13.14.0 -t 14.3.0 -r node --verbose --include-regex \".*(node|a|so|dll|dylib)$\" -- -O build --CDENABLE_SHARED=off --CDENABLE_CAPI=off --CDENABLE_TESTS=off --CDTARGET_RPATH=\"@executable_path;/usr/local/lib;/usr/local/lib64;\\$\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/../node_modules/cfd-js/build/Release;\\$ORIGIN/../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/build/Release;\\$ORIGIN/wrap_js/dl_lib/lib\" -C --CDnapi_build_version=3", - "prebuild_electron": "prebuild --backend cmake-js -t 3.0.0 -t 4.0.4 -t 5.0.0 -t 6.0.0 -t 7.0.0 -t 8.0.0 -t 9.0.0 -r electron --verbose --include-regex \".*(node|a|so|dll|dylib)$\" -- -O build --CDENABLE_SHARED=off --CDENABLE_CAPI=off --CDENABLE_TESTS=off --CDTARGET_RPATH=\"@executable_path;/usr/local/lib;/usr/local/lib64;\\$\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/../node_modules/cfd-js/build/Release;\\$ORIGIN/../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/build/Release;\\$ORIGIN/wrap_js/dl_lib/lib\" -C --CDnapi_build_version=3", + "prebuild_nodejs": "prebuild --backend cmake-js -t 14.3.0 -t 8.17.0 -t 10.20.1 -t 12.16.3 -r node --verbose --include-regex \".*(node|a|so|dll|dylib)$\" -- -O build --CDENABLE_SHARED=off --CDENABLE_CAPI=off --CDENABLE_TESTS=off --CDTARGET_RPATH=\"@executable_path;/usr/local/lib;/usr/local/lib64;\\$\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/../node_modules/cfd-js/build/Release;\\$ORIGIN/../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/build/Release;\\$ORIGIN/wrap_js/dl_lib/lib\" -C --CDnapi_build_version=3", + "prebuild_electron": "prebuild --backend cmake-js -t 10.0.0-beta.1 -t 9.0.0 -t 8.0.0 -t 7.0.0 -t 6.0.0 -r electron --verbose --include-regex \".*(node|a|so|dll|dylib)$\" -- -O build --CDENABLE_SHARED=off --CDENABLE_CAPI=off --CDENABLE_TESTS=off --CDTARGET_RPATH=\"@executable_path;/usr/local/lib;/usr/local/lib64;\\$\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/node_modules/cfd-js/build/Release;\\$ORIGIN/../node_modules/cfd-js/build/Release;\\$ORIGIN/../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/../../../../../../node_modules/cfd-js/build/Release;\\$ORIGIN/build/Release;\\$ORIGIN/wrap_js/dl_lib/lib\" -C --CDnapi_build_version=3", "prebuild_upload_all": "prebuild --upload-all", "check_version": "node ./tools/checker.js version", "download_object": "node ./pkg_getter.js", @@ -167,6 +168,7 @@ "del-cli": "^3.0.1", "got": "^10.7.0", "nan": "^2.14.1", + "node-abi": "2.18.0", "node-addon-api": "^1.7.2", "node-gyp": "^5.1.1", "npm-run-all": "^4.1.5", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8a8ff343..fb9b2d9c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,11 @@ if(NOT CFD_SRC_ROOT_DIR) set(CFD_SRC_ROOT_DIR ${CMAKE_SOURCE_DIR}) endif() -find_package(cfd QUIET) + +find_package(univalue QUIET CONFIG) +find_package(wally QUIET CONFIG) +find_package(cfdcore QUIET CONFIG) +find_package(cfd QUIET CONFIG) if((NOT cfd_FOUND) OR (NOT ${cfd_FOUND})) set(CFD_LIBRARY cfd) set(CFDCORE_LIBRARY cfdcore) diff --git a/src/autogen/cfd_js_api_json_autogen.cpp b/src/autogen/cfd_js_api_json_autogen.cpp index cda58f96..d26cb8fa 100644 --- a/src/autogen/cfd_js_api_json_autogen.cpp +++ b/src/autogen/cfd_js_api_json_autogen.cpp @@ -1088,13 +1088,6 @@ void AddSignRequest::CollectFieldName() { } cfd::core::CLASS_FUNCTION_TABLE func_table; // NOLINT - func_table = { - AddSignRequest::GetTxString, - AddSignRequest::SetTxString, - AddSignRequest::GetTxFieldType, - }; - json_mapper.emplace("tx", func_table); - item_list.push_back("tx"); func_table = { AddSignRequest::GetIsElementsString, AddSignRequest::SetIsElementsString, @@ -1102,6 +1095,13 @@ void AddSignRequest::CollectFieldName() { }; json_mapper.emplace("isElements", func_table); item_list.push_back("isElements"); + func_table = { + AddSignRequest::GetTxString, + AddSignRequest::SetTxString, + AddSignRequest::GetTxFieldType, + }; + json_mapper.emplace("tx", func_table); + item_list.push_back("tx"); func_table = { AddSignRequest::GetTxinString, AddSignRequest::SetTxinString, @@ -1113,16 +1113,16 @@ void AddSignRequest::CollectFieldName() { void AddSignRequest::ConvertFromStruct( const AddSignRequestStruct& data) { - tx_ = data.tx; is_elements_ = data.is_elements; + tx_ = data.tx; txin_.ConvertFromStruct(data.txin); ignore_items = data.ignore_items; } AddSignRequestStruct AddSignRequest::ConvertToStruct() const { // NOLINT AddSignRequestStruct result; - result.tx = tx_; result.is_elements = is_elements_; + result.tx = tx_; result.txin = txin_.ConvertToStruct(); result.ignore_items = ignore_items; return result; @@ -8368,6 +8368,13 @@ void EstimateFeeResponse::CollectFieldName() { }; json_mapper.emplace("txFeeAmount", func_table); item_list.push_back("txFeeAmount"); + func_table = { + EstimateFeeResponse::GetTxoutFeeAmountString, + EstimateFeeResponse::SetTxoutFeeAmountString, + EstimateFeeResponse::GetTxoutFeeAmountFieldType, + }; + json_mapper.emplace("txoutFeeAmount", func_table); + item_list.push_back("txoutFeeAmount"); func_table = { EstimateFeeResponse::GetUtxoFeeAmountString, EstimateFeeResponse::SetUtxoFeeAmountString, @@ -8381,6 +8388,7 @@ void EstimateFeeResponse::ConvertFromStruct( const EstimateFeeResponseStruct& data) { fee_amount_ = data.fee_amount; tx_fee_amount_ = data.tx_fee_amount; + txout_fee_amount_ = data.txout_fee_amount; utxo_fee_amount_ = data.utxo_fee_amount; ignore_items = data.ignore_items; } @@ -8389,6 +8397,7 @@ EstimateFeeResponseStruct EstimateFeeResponse::ConvertToStruct() const { // NOL EstimateFeeResponseStruct result; result.fee_amount = fee_amount_; result.tx_fee_amount = tx_fee_amount_; + result.txout_fee_amount = txout_fee_amount_; result.utxo_fee_amount = utxo_fee_amount_; result.ignore_items = ignore_items; return result; diff --git a/src/autogen/cfd_js_api_json_autogen.h b/src/autogen/cfd_js_api_json_autogen.h index 8c55d6f7..c90cc400 100644 --- a/src/autogen/cfd_js_api_json_autogen.h +++ b/src/autogen/cfd_js_api_json_autogen.h @@ -4750,89 +4750,89 @@ class AddSignRequest static void CollectFieldName(); /** - * @brief Get of tx - * @return tx + * @brief Get of isElements + * @return isElements */ - std::string GetTx() const { - return tx_; + bool GetIsElements() const { + return is_elements_; } /** - * @brief Set to tx - * @param[in] tx setting value. + * @brief Set to isElements + * @param[in] is_elements setting value. */ - void SetTx( // line separate - const std::string& tx) { // NOLINT - this->tx_ = tx; + void SetIsElements( // line separate + const bool& is_elements) { // NOLINT + this->is_elements_ = is_elements; } /** - * @brief Get data type of tx - * @return Data type of tx + * @brief Get data type of isElements + * @return Data type of isElements */ - static std::string GetTxFieldType() { - return "std::string"; + static std::string GetIsElementsFieldType() { + return "bool"; } /** - * @brief Get json string of tx field. + * @brief Get json string of isElements field. * @param[in,out] obj class object. * @return JSON string */ - static std::string GetTxString( // line separate + static std::string GetIsElementsString( // line separate const AddSignRequest& obj) { // NOLINT - return cfd::core::ConvertToString(obj.tx_); + return cfd::core::ConvertToString(obj.is_elements_); } /** - * @brief Set json object to tx field. + * @brief Set json object to isElements field. * @param[in,out] obj class object. * @param[in] json_value JSON object. */ - static void SetTxString( // line separate + static void SetIsElementsString( // line separate AddSignRequest& obj, // NOLINT const UniValue& json_value) { cfd::core::ConvertFromUniValue( // line separate - obj.tx_, json_value); + obj.is_elements_, json_value); } /** - * @brief Get of isElements - * @return isElements + * @brief Get of tx + * @return tx */ - bool GetIsElements() const { - return is_elements_; + std::string GetTx() const { + return tx_; } /** - * @brief Set to isElements - * @param[in] is_elements setting value. + * @brief Set to tx + * @param[in] tx setting value. */ - void SetIsElements( // line separate - const bool& is_elements) { // NOLINT - this->is_elements_ = is_elements; + void SetTx( // line separate + const std::string& tx) { // NOLINT + this->tx_ = tx; } /** - * @brief Get data type of isElements - * @return Data type of isElements + * @brief Get data type of tx + * @return Data type of tx */ - static std::string GetIsElementsFieldType() { - return "bool"; + static std::string GetTxFieldType() { + return "std::string"; } /** - * @brief Get json string of isElements field. + * @brief Get json string of tx field. * @param[in,out] obj class object. * @return JSON string */ - static std::string GetIsElementsString( // line separate + static std::string GetTxString( // line separate const AddSignRequest& obj) { // NOLINT - return cfd::core::ConvertToString(obj.is_elements_); + return cfd::core::ConvertToString(obj.tx_); } /** - * @brief Set json object to isElements field. + * @brief Set json object to tx field. * @param[in,out] obj class object. * @param[in] json_value JSON object. */ - static void SetIsElementsString( // line separate + static void SetTxString( // line separate AddSignRequest& obj, // NOLINT const UniValue& json_value) { cfd::core::ConvertFromUniValue( // line separate - obj.is_elements_, json_value); + obj.tx_, json_value); } /** @@ -4948,14 +4948,14 @@ class AddSignRequest */ std::set ignore_items; - /** - * @brief JsonAPI(tx) value - */ - std::string tx_ = ""; /** * @brief JsonAPI(isElements) value */ bool is_elements_ = false; + /** + * @brief JsonAPI(tx) value + */ + std::string tx_ = ""; /** * @brief JsonAPI(txin) value */ @@ -37519,6 +37519,49 @@ class EstimateFeeResponse obj.tx_fee_amount_, json_value); } + /** + * @brief Get of txoutFeeAmount + * @return txoutFeeAmount + */ + int64_t GetTxoutFeeAmount() const { + return txout_fee_amount_; + } + /** + * @brief Set to txoutFeeAmount + * @param[in] txout_fee_amount setting value. + */ + void SetTxoutFeeAmount( // line separate + const int64_t& txout_fee_amount) { // NOLINT + this->txout_fee_amount_ = txout_fee_amount; + } + /** + * @brief Get data type of txoutFeeAmount + * @return Data type of txoutFeeAmount + */ + static std::string GetTxoutFeeAmountFieldType() { + return "int64_t"; + } + /** + * @brief Get json string of txoutFeeAmount field. + * @param[in,out] obj class object. + * @return JSON string + */ + static std::string GetTxoutFeeAmountString( // line separate + const EstimateFeeResponse& obj) { // NOLINT + return cfd::core::ConvertToString(obj.txout_fee_amount_); + } + /** + * @brief Set json object to txoutFeeAmount field. + * @param[in,out] obj class object. + * @param[in] json_value JSON object. + */ + static void SetTxoutFeeAmountString( // line separate + EstimateFeeResponse& obj, // NOLINT + const UniValue& json_value) { + cfd::core::ConvertFromUniValue( // line separate + obj.txout_fee_amount_, json_value); + } + /** * @brief Get of utxoFeeAmount * @return utxoFeeAmount @@ -37639,6 +37682,10 @@ class EstimateFeeResponse * @brief JsonAPI(txFeeAmount) value */ int64_t tx_fee_amount_ = 0; + /** + * @brief JsonAPI(txoutFeeAmount) value + */ + int64_t txout_fee_amount_ = 0; /** * @brief JsonAPI(utxoFeeAmount) value */ diff --git a/src/cfdjs_elements_transaction.cpp b/src/cfdjs_elements_transaction.cpp index 88d80364..6cbdb9ed 100644 --- a/src/cfdjs_elements_transaction.cpp +++ b/src/cfdjs_elements_transaction.cpp @@ -2025,6 +2025,7 @@ void ElementsTransactionJsonApi::EstimateFee( response->SetFeeAmount(fee.GetSatoshiValue()); response->SetTxFeeAmount(tx_fee.GetSatoshiValue()); + response->SetTxoutFeeAmount(tx_fee.GetSatoshiValue()); response->SetUtxoFeeAmount(utxo_fee.GetSatoshiValue()); } diff --git a/src/cfdjs_transaction.cpp b/src/cfdjs_transaction.cpp index b489ce7d..0d2aa9db 100644 --- a/src/cfdjs_transaction.cpp +++ b/src/cfdjs_transaction.cpp @@ -874,6 +874,7 @@ void TransactionJsonApi::EstimateFee( response->SetFeeAmount(fee.GetSatoshiValue()); response->SetTxFeeAmount(tx_fee.GetSatoshiValue()); + response->SetTxoutFeeAmount(tx_fee.GetSatoshiValue()); response->SetUtxoFeeAmount(utxo_fee.GetSatoshiValue()); } diff --git a/src/input_json_format/cfdapi_add_multisig_sign.json b/src/input_json_format/cfdapi_add_multisig_sign.json index 73845c09..b63600f6 100644 --- a/src/input_json_format/cfdapi_add_multisig_sign.json +++ b/src/input_json_format/cfdapi_add_multisig_sign.json @@ -1,37 +1,53 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Add multisig signatures to the transaction.", "request": { ":class": "AddMultisigSignRequest", - ":class:comment": "Add signatures to multisig input", + ":class:comment": "Multisig input data to add to tx.", "isElements": false, "isElements:require": "optional", + "isElements:comment": "elements transaction flag.", "tx": "", "tx:require": "require", "tx:comment": "transaction hex", + "txin:require": "require", + "txin:comment": "transaction input data", "txin": { ":class": "AddMultisigSignTxInRequest", + ":class:comment": "Multisig signature input data.", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, "vout:type": "uint32_t", "vout:require": "require", + "vout:comment": "utxo vout.", + "signParams:require": "require", + "signParams:comment": "signature list.", "signParams": [ { ":class": "MultisigSignData", + ":class:comment": "Multisig signature data.", "hex": "", "hex:require": "require", + "hex:comment": "signature hex.", "type": "sign", "type:require": "optional", + "type:comment": "parameter type.", "type:hint": "sign only", "derEncode": true, "derEncode:require": "optional", + "derEncode:comment": "der encode option flag", "sighashType": "all", "sighashType:require": "optional", + "sighashType:comment": "signature hash type.", "sighashType:hint": "all, none or single", "sighashAnyoneCanPay": false, "sighashAnyoneCanPay:require": "optional", + "sighashAnyoneCanPay:comment": "sighashType anyone can pay flag.", "relatedPubkey": "", - "relatedPubkey:require": "optional" + "relatedPubkey:require": "optional", + "relatedPubkey:comment": "a pubkey related to signature." } ], "redeemScript": "", @@ -42,6 +58,7 @@ "witnessScript:comment": "(required for P2WSH or P2SH-P2WSH) witness script for witness stack", "hashType": "", "hashType:require": "require", + "hashType:comment": "hash type.", "hashType:hint": "p2sh, p2wsh or p2sh-p2wsh", "clearStack": true, "clearStack:require": "optional", @@ -50,7 +67,9 @@ }, "response": { ":class": "AddMultisigSignResponse", + ":class:comment": "The output data with signature added.", "hex": "", - "hex:require": "require" + "hex:require": "require", + "hex:comment": "signed transaction hex." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_add_pubkey_hash_sign.json b/src/input_json_format/cfdapi_add_pubkey_hash_sign.json index 68405aef..6c27ccb2 100644 --- a/src/input_json_format/cfdapi_add_pubkey_hash_sign.json +++ b/src/input_json_format/cfdapi_add_pubkey_hash_sign.json @@ -1,47 +1,64 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Add a signature and pubkey to the transaction.", "request": { ":class": "AddPubkeyHashSignRequest", - ":class:comment": "Add signatures to pubkey hash input", + ":class:comment": "pubkey hash input data to add to tx.", "isElements": false, "isElements:require": "optional", + "isElements:comment": "elements transaction flag.", "tx": "", "tx:require": "require", "tx:comment": "transaction hex", + "txin:require": "require", + "txin:comment": "transaction input data", "txin": { ":class": "AddPubkeyHashSignTxInRequest", + ":class:comment": "pubkey hash input data", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, "vout:type": "uint32_t", "vout:require": "require", + "vout:comment": "utxo vout.", + "signParam:require": "require", + "signParam:comment": "sign parameter.", "signParam": { ":class": "PubkeyHashSignData", + ":class:comment": "pubkey hash signature data", "hex": "", "hex:require": "require", "hex:comment": "signature hex.", "type": "sign", "type:require": "optional", + "type:comment": "parameter type.", "type:hint": "sign only", "derEncode": true, "derEncode:require": "optional", + "derEncode:comment": "der encode option flag", "sighashType": "all", "sighashType:require": "optional", + "sighashType:comment": "signature hash type.", "sighashType:hint": "all, none or single", "sighashAnyoneCanPay": false, - "sighashAnyoneCanPay:require": "optional" + "sighashAnyoneCanPay:require": "optional", + "sighashAnyoneCanPay:comment": "sighashType anyone can pay flag." }, "pubkey": "", "pubkey:require": "require", "pubkey:comment": "public key.", "hashType": "", "hashType:require": "require", + "hashType:comment": "hash type.", "hashType:hint": "p2pkh, p2wpkh or p2sh-p2wpkh" } }, "response": { ":class": "AddPubkeyHashSignResponse", + ":class:comment": "The output data with signature added.", "hex": "", - "hex:require": "require" + "hex:require": "require", + "hex:comment": "signed transaction hex." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_add_raw_transaction.json b/src/input_json_format/cfdapi_add_raw_transaction.json index c380fcec..a19b4145 100644 --- a/src/input_json_format/cfdapi_add_raw_transaction.json +++ b/src/input_json_format/cfdapi_add_raw_transaction.json @@ -1,40 +1,54 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Add tx inputs and tx outputs to the transaction.", "request": { ":class": "AddRawTransactionRequest", + ":class:comment": "The data added to the transaction.", "tx": "", "tx:require": "require", "tx:comment": "transaction hex", "txins:require": "optional", + "txins:comment": "This list is added to the transaction input.", "txins": [ { ":class": "AddTxIn", + ":class:comment": "The data added to the transaction input.", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, "vout:type": "uint32_t", "vout:require": "require", + "vout:comment": "utxo vout.", "sequence": 4294967295, "sequence:type": "uint32_t", + "sequence:comment": "sequence number.", "sequence:require": "optional" } ], "txouts:require": "optional", + "txins:comment": "This list is added to the transaction output.", "txouts": [ { ":class": "AddTxOut", + ":class:comment": "The data added to the transaction output.", "address": "", "address:require": "require", + "address:comment": "bitcoin address.", "amount": 0, "amount:require": "require", + "amount:comment": "satoshi amount.", "directLockingScript": "", - "directLockingScript:require": "optional" + "directLockingScript:require": "optional", + "directLockingScript:comment": "Set to locking script. (When using a script that cannot be expressed as an address)" } ] }, "response": { ":class": "AddRawTransactionResponse", + ":class:comment": "The output transaction data.", "hex": "", - "hex:require": "require" + "hex:require": "require", + "hex:comment": "transaction hex." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_add_script_hash_sign.json b/src/input_json_format/cfdapi_add_script_hash_sign.json index e2178b3d..fd3976c7 100644 --- a/src/input_json_format/cfdapi_add_script_hash_sign.json +++ b/src/input_json_format/cfdapi_add_script_hash_sign.json @@ -1,38 +1,50 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Add a signature and redeem script to the transaction.", "request": { ":class": "AddScriptHashSignRequest", - ":class:comment": "Add signatures to pubkey hash input", + ":class:comment": "script hash input data to add to tx.", "isElements": false, "isElements:require": "optional", + "isElements:comment": "elements transaction flag.", "tx": "", "tx:require": "require", "tx:comment": "transaction hex", + "txin:require": "require", + "txin:comment": "transaction input data", "txin": { ":class": "AddScriptHashSignTxInRequest", + ":class:comment": "script hash input data", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, "vout:type": "uint32_t", "vout:require": "require", + "vout:comment": "utxo vout.", "signParam:require": "require", + "signParam:comment": "sign parameter list.", "signParam": [ { ":class": "ScriptHashSignData", + ":class:comment": "signature data", "hex": "", "hex:require": "require", "hex:comment": "If the type is auto or op_code, character string input is enabled. Others are hex byte array only.", "type": "auto", "type:require": "optional", + "type:comment": "parameter type.", "type:hint": "binary, sign", "derEncode": false, "derEncode:require": "optional", - "derEncode:comment": "Valid when type is auto or sign.", + "derEncode:comment": "der encode option flag. Valid when type is auto or sign.", "sighashType": "all", "sighashType:require": "optional", + "sighashType:comment": "signature hash type.", "sighashType:hint": "all, none, single", "sighashAnyoneCanPay": false, - "sighashAnyoneCanPay:require": "optional" + "sighashAnyoneCanPay:require": "optional", + "sighashAnyoneCanPay:comment": "sighashType anyone can pay flag." } ], "redeemScript": "", @@ -40,12 +52,15 @@ "redeemScript:comment": "redeem script.", "hashType": "", "hashType:require": "require", + "hashType:comment": "hash type.", "hashType:hint": "p2sh, p2wsh or p2sh-p2wsh" } }, "response": { ":class": "AddScriptHashSignResponse", + ":class:comment": "The output data with signature added.", "hex": "", - "hex:require": "require" + "hex:require": "require", + "hex:comment": "signed transaction hex." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_add_sign.json b/src/input_json_format/cfdapi_add_sign.json index a33ebda7..356ddf0d 100644 --- a/src/input_json_format/cfdapi_add_sign.json +++ b/src/input_json_format/cfdapi_add_sign.json @@ -1,39 +1,53 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Add a sign data to the transaction.", "request": { ":class": "AddSignRequest", + ":class:comment": "Sign input data to add to tx.", + "isElements": false, + "isElements:require": "optional", + "isElements:comment": "elements transaction flag.", "tx": "", "tx:require": "require", "tx:comment": "transaction hex", - "isElements": false, - "isElements:require": "optional", + "txin:require": "require", + "txin:comment": "transaction input data", "txin": { ":class": "AddSignTxInRequest", + ":class:comment": "Sign input data.", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, "vout:type": "uint32_t", "vout:require": "require", + "vout:comment": "utxo vout.", "isWitness": true, "isWitness:require": "optional", + "isWitness:comment": "use witness stack flag.", "signParam:require": "require", + "signParam:comment": "sign parameter list.", "signParam": [ { ":class": "SignData", + ":class:comment": "The sign data.", "hex": "", "hex:require": "require", "hex:comment": "If the type is auto or op_code, character string input is enabled. Others are hex byte array only.", "type": "auto", "type:require": "optional", + "type:comment": "parameter type.", "type:hint": "auto, binary, sign, pubkey, redeem_script, op_code", "derEncode": false, "derEncode:require": "optional", - "derEncode:comment": "Valid when type is auto or sign.", + "derEncode:comment": "der encode option flag. Valid when type is auto or sign.", "sighashType": "all", "sighashType:require": "optional", + "sighashType:comment": "signature hash type.", "sighashType:hint": "all, none, single", "sighashAnyoneCanPay": false, - "sighashAnyoneCanPay:require": "optional" + "sighashAnyoneCanPay:require": "optional", + "sighashAnyoneCanPay:comment": "sighashType anyone can pay flag." } ], "clearStack": true, @@ -43,7 +57,9 @@ }, "response": { ":class": "AddSignResponse", + ":class:comment": "The output data with signature added.", "hex": "", - "hex:require": "require" + "hex:require": "require", + "hex:comment": "signed transaction hex." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_append_descriptor_checksum.json b/src/input_json_format/cfdapi_append_descriptor_checksum.json index 6e728705..f72ad92d 100644 --- a/src/input_json_format/cfdapi_append_descriptor_checksum.json +++ b/src/input_json_format/cfdapi_append_descriptor_checksum.json @@ -1,15 +1,21 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Get output descriptor added checksum.", "request": { ":class": "AppendDescriptorChecksumRequest", + ":class:comment": "The output descriptor request data.", "descriptor": "", "descriptor:require": "require", + "descriptor:comment": "output descriptor.", "isElements": false, - "isElements:require": "optional" + "isElements:require": "optional", + "isElements:comment": "elements transaction flag." }, "response": { ":class": "AppendDescriptorChecksumResponse", + ":class:comment": "The data containing output descriptor.", "descriptor": "", - "descriptor:require": "require" + "descriptor:require": "require", + "descriptor:comment": "output descriptor." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_blind_raw_transaction.json b/src/input_json_format/cfdapi_blind_raw_transaction.json index 209172dc..d49d4760 100644 --- a/src/input_json_format/cfdapi_blind_raw_transaction.json +++ b/src/input_json_format/cfdapi_blind_raw_transaction.json @@ -1,69 +1,96 @@ { "namespace": ["cfd","js","api","json"], + "comment": "blind the transaction.", "request": { ":class": "BlindRawTransactionRequest", + ":class:comment": "Request blind the transaction.", "tx": "", "tx:require": "require", "tx:comment": "transaction hex", + "txins:require": "require", + "txins:comment": "input data list.", "txins": [ { ":class": "BlindTxInRequest", + ":class:comment": "Tx input data for blinding.", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, - "vout:require": "require", "vout:type": "uint32_t", + "vout:require": "require", + "vout:comment": "utxo vout.", "asset": "", "asset:require": "require", + "asset:comment": "asset hex.", "blindFactor": "", "blindFactor:require": "optional", + "blindFactor:comment": "amount blinder.", "assetBlindFactor": "", "assetBlindFactor:require": "optional", + "assetBlindFactor:comment": "asset blinder.", "amount": 0, - "amount:require": "require" + "amount:require": "require", + "amount:comment": "satoshi amount." } ], "txouts:require": "optional", + "txouts:comment": "output data list. Used when directly setting ConfidentialKey.", "txouts": [ { ":class": "BlindTxOutRequest", + ":class:comment": "Tx output data for blinding.", "index": 0, "index:type": "uint32_t", "index:require": "require", + "index:comment": "target txout index.", "confidentialKey": "", "confidentialKey:require": "require", + "confidentialKey:comment": "confidential key.", "blindPubkey": "", "blindPubkey:require": "optional", - "blindPubkey:comment": "deprecated field" + "blindPubkey:comment": "(deprecated field)" } ], "txoutConfidentialAddresses": [""], "txoutConfidentialAddresses:require": "optional", - "txoutConfidentialAddresses:comment": "confidential address list", + "txoutConfidentialAddresses:comment": "Confidential address list. Use instead of txouts.", "issuances:require": "optional", + "issuances:comment": "used when issue/reissue transaction", "issuances":[ { ":class": "BlindIssuanceRequest", + ":class:comment": "Tx input issuance data for blinding.", "txid": "", "txid:require": "require", + "txid:comment": "utxo txid.", "vout": 0, - "vout:require": "require", "vout:type": "uint32_t", + "vout:require": "require", + "vout:comment": "utxo vout.", "assetBlindingKey":"", "assetBlindingKey:require": "require", + "assetBlindingKey:comment": "asset blinding key.", "tokenBlindingKey":"", - "tokenBlindingKey:require": "optional" + "tokenBlindingKey:require": "optional", + "tokenBlindingKey:comment": "token blinding key. Used when issue transaction." } ], "minimumRangeValue": 1, + "minimumRangeValue:require": "optional", + "minimumRangeValue:comment": "rangeproof minimum value.", "exponent": 0, "exponent:type": "int", + "exponent:comment": "An exponential value that guarantees a range of rangeproof.", "minimumBits": 52, - "minimumBits:type": "int" + "minimumBits:type": "int", + "minimumBits:comment": "minimum bits of rangeproof." }, "response": { ":class": "BlindRawTransactionResponse", + ":class:comment": "The data containing blinded transaction.", "hex": "", - "hex:require": "require" + "hex:require": "require", + "hex:comment": "blinded transaction hex." } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_calculate_ec_signature.json b/src/input_json_format/cfdapi_calculate_ec_signature.json index 2fed7a35..b3c6880a 100644 --- a/src/input_json_format/cfdapi_calculate_ec_signature.json +++ b/src/input_json_format/cfdapi_calculate_ec_signature.json @@ -1,27 +1,38 @@ { "namespace": ["cfd","js","api","json"], + "comment": "calculate ec signature.", "request": { ":class": "CalculateEcSignatureRequest", + ":class:comment": "request ec signature data.", "sighash": "", "sighash:require": "require", + "sighash:comment": "signature hash.", "privkeyData": { ":class": "PrivkeyData", + ":class:comment": "private key data.", "privkey": "", "privkey:require": "require", + "privkey:comment": "private key. set is wif or hex.", "wif": true, "wif:require": "require", + "wif:comment": "use wif flag. true is wif, false is hex.", "network": "mainnet", "network:require": "optional", + "network:comment": "wif network type.", "network:hint": "mainnet, testnet or regtest", "isCompressed": true, - "isCompressed:require": "optional" + "isCompressed:require": "optional", + "isCompressed:comment": "wif compressed flag" }, "isGrindR": true, - "isGrindR:require": "optional" + "isGrindR:require": "optional", + "isGrindR:comment": "Grind-R flag" }, "response": { ":class": "CalculateEcSignatureResponse", + ":class:comment": "response ec signature data.", "signature": "", - "signature:require": "require" + "signature:require": "require", + "signature:comment": "ec signature" } } \ No newline at end of file diff --git a/src/input_json_format/cfdapi_convert_aes.json b/src/input_json_format/cfdapi_convert_aes.json index c90b8e19..7b4eebd4 100644 --- a/src/input_json_format/cfdapi_convert_aes.json +++ b/src/input_json_format/cfdapi_convert_aes.json @@ -1,19 +1,22 @@ { "namespace": ["cfd","js","api","json"], + "comment": "Encode/Decode AES.", "request": { ":class": "ConvertAesRequest", + ":class:comment": "Request AES data.", "isEncrypt": true, "isEncrypt:require": "require", - "isEncrypt:hint": "false is decrypto", + "isEncrypt:comment": "aes encrypto flag. true is encrypto, false is decrypto", "mode": "cbc", "mode:require": "optional", + "mode:comment": "AES mode. (for feature)", "mode:hint": "cbc only", "key": "", "key:require": "require", - "key:comment": "key data (32 byte)", + "key:comment": "key data (32 byte: 64 char hex)", "iv": "", "iv:require": "optional", - "iv:comment": "initial vector (16 byte)", + "iv:comment": "initial vector (16 byte: 32 char hex)", "iv:hint": "using by cbc mode only.", "data": "", "data:require": "require", @@ -21,6 +24,7 @@ }, "response": { ":class": "ConvertAesResponse", + ":class:comment": "The data converted by AES.", "hex": "", "hex:require": "require", "hex:comment": "encrypted or decrypted data" diff --git a/src/input_json_format/cfdapi_estimate_fee.json b/src/input_json_format/cfdapi_estimate_fee.json index ca30731f..224bb56e 100644 --- a/src/input_json_format/cfdapi_estimate_fee.json +++ b/src/input_json_format/cfdapi_estimate_fee.json @@ -68,11 +68,18 @@ "feeAmount": 0, "feeAmount:type": "int64_t", "feeAmount:require": "require", + "feeAmount:comment": "tx fee amount. (txoutFeeAmount + utxoFeeAmount)", "txFeeAmount": 0, "txFeeAmount:type": "int64_t", "txFeeAmount:require": "optional", + "txFeeAmount:comment": "(deprecated: rename to txoutFeeAmount)", + "txoutFeeAmount": 0, + "txoutFeeAmount:type": "int64_t", + "txoutFeeAmount:require": "optional", + "txoutFeeAmount:comment": "fee of tx output & base area.", "utxoFeeAmount": 0, "utxoFeeAmount:type": "int64_t", - "utxoFeeAmount:require": "optional" + "utxoFeeAmount:require": "optional", + "utxoFeeAmount:comment": "fee of tx inputs utxo." } } \ No newline at end of file diff --git a/tools/generate_json_map_class.ts b/tools/generate_json_map_class.ts index 29703dc6..85f39777 100644 --- a/tools/generate_json_map_class.ts +++ b/tools/generate_json_map_class.ts @@ -12,26 +12,39 @@ interface JsonObjectCommonType { }; interface ClassMapType { - [key: string]: any; + [key: string]: ParameterType[]; +}; + +interface ClassCommentMapType { + [key: string]: string; +}; + +interface ClassParameterType { + name: string; + comment: string; }; interface CollectMapDataResponse { type: string; map: ClassMapType; - list: any[]; + list: ClassParameterType[]; + comment: string; }; interface ParameterType { name: string; type: string; + comment: string; }; interface TsAppendFunctionData { name: string; parameters: ParameterType[]; returnType: string; + comment: string; }; + // ---------------------------------------------------------------------------- // debug log function // ---------------------------------------------------------------------------- @@ -49,12 +62,14 @@ class JsonMappingData { variableName: string; initValue: string | number | boolean; className: string; + classComment: string; childList: {[key: string]: JsonMappingData}; parent: null; isOutputStruct: boolean; isArray: boolean; isObject: boolean; isRequire: boolean; + comment: string; type: string; structType: string; constructor(name: string, type: string, initValue: string | number | boolean, @@ -80,6 +95,8 @@ class JsonMappingData { this.isArray = false; this.isObject = false; this.isRequire = false; + this.comment = ''; + this.classComment = ''; // Reserved word support. // TODO(k-matsuzawa): If the number increases, make a list. if (this.variableName == 'asm') this.variableName = `${this.variableName}_`; @@ -102,6 +119,14 @@ class JsonMappingData { this.isRequire = true; } } + setComment(comment: string, hint: string) { + if (comment) { + this.comment = comment; + if (hint) { + this.comment = `${comment} (${hint})`; + } + } + } setTypeStruct(type: string, structType: any) { this.type = type; @@ -125,21 +150,27 @@ class JsonMappingData { return str; } - collectMapData(map: ClassMapType, list: any[], + collectMapData(map: ClassMapType, list: ClassParameterType[], isRequest: boolean): CollectMapDataResponse { - if (this.type.startsWith('JsonValueVector') || this.type.startsWith('JsonObjectVector')) { + if (this.type.startsWith('JsonValueVector') || + this.type.startsWith('JsonObjectVector')) { for (const key in this.childList) { if (!{}.hasOwnProperty.call(this.childList, key)) continue; if (this.childList[key]) { const ret = this.childList[key].collectMapData(map, list, isRequest); - return {type: ret['type'] + '[]', map: ret['map'], list: ret['list']}; + return { + type: ret['type'] + '[]', + map: ret['map'], + list: ret['list'], + comment: ret['comment'], + }; } break; } throw Error('Illegal state.'); } else if (this.type === 'ErrorResponseBase') { const clsName = 'ErrorResponse'; - const props = []; + const props: ParameterType[] = []; let tmpMap = map; let tmpList = list; for (const key in this.childList) { @@ -148,17 +179,23 @@ class JsonMappingData { const ret = this.childList[key].collectMapData( tmpMap, tmpList, isRequest); const type = ret['type']; + const comment = ret['comment']; tmpMap = ret['map']; tmpList = ret['list']; if (name === 'isOutputStruct') { continue; } - props.push({name: name, type: type}); + props.push({name: name, type: type, comment}); } } tmpMap[clsName] = props; - tmpList.push(clsName); - return {type: clsName, map: tmpMap, list: tmpList}; + tmpList.push({name: clsName, comment: this.classComment}); + return { + type: clsName, + map: tmpMap, + list: tmpList, + comment: this.classComment, + }; } else if (Object.keys(this.childList).length > 0) { // my class name const props = []; @@ -171,18 +208,26 @@ class JsonMappingData { tmpMap, tmpList, isRequest); debugLog('prop : ', ret); const type = ret['type']; + const comment = ret['comment']; tmpMap = ret['map']; tmpList = ret['list']; if (name.indexOf('-') > 0) { name = '\'' + name + '\''; } - props.push({name: name, type: type}); + props.push({name: name, type: type, comment: comment}); } } + debugLog(`type = ${this.type}, comment = ${this.comment}`); + debugLog(`class = ${this.className}, clsComment = ${this.classComment}`); debugLog('props = ', props); tmpMap[this.type] = props; - tmpList.push(this.type); - return {type: this.type, map: tmpMap, list: tmpList}; + tmpList.push({name: this.type, comment: this.classComment}); + return { + type: this.type, + map: tmpMap, + list: tmpList, + comment: this.comment || this.classComment, + }; } else { let type = ''; if (this.type === 'std::string') { @@ -194,7 +239,7 @@ class JsonMappingData { } else { type = 'number'; } - return {type: type, map: map, list: list}; + return {type: type, map: map, list: list, comment: this.comment}; } } @@ -298,12 +343,19 @@ const analyzeJson = (jsonObj: any | any[], } else { // object debugLog(`read keys = ${objKey}`); let className = objName; + let classComment = ''; if (':class' in jsonObj) { if (typeof jsonObj[':class'] === 'string') { className = jsonObj[':class']; debugLog(`read className = ${className}`); } } + if (':class:comment' in jsonObj) { + if (typeof jsonObj[':class:comment'] === 'string') { + classComment = jsonObj[':class:comment']; + debugLog(`read classComment = ${classComment}`); + } + } let isOutputStruct = true; if (':isOutputStruct' in jsonObj) { if (typeof jsonObj[':isOutputStruct'] === 'boolean') { @@ -314,19 +366,24 @@ const analyzeJson = (jsonObj: any | any[], // Class name is set by the caller. result = new JsonMappingData(objName, className, '', '', isOutputStruct); result.isObject = true; + result.classComment = classComment; // Stored in temporary map to maintain sort order. const tmpMap: {[key: string]: JsonMappingData} = {}; const requireMap: {[key: string]: string} = {}; + const clsCommentMap: {[key: string]: string} = {}; + const commentMap: {[key: string]: string} = {}; + const hintMap: {[key: string]: string} = {}; const rarraytypeMap: {[key: string]: string} = {}; for (const key in jsonObj) { if (!{}.hasOwnProperty.call(jsonObj, key)) continue; - if (key != ':class') { + if ((key != ':class') && (key != ':class:comment')) { if (key.lastIndexOf(':type') >= 0) { const keyName = key.split(':')[0]; if (tmpMap[keyName]) { tmpMap[keyName].setType(jsonObj[key]); } else { const data = new JsonMappingData(keyName, jsonObj[key], '', className, isOutputStruct); + data.classComment = classComment; tmpMap[keyName] = data; debugLog(`set JsonMappingData = ${keyName}`); } @@ -339,6 +396,19 @@ const analyzeJson = (jsonObj: any | any[], const keyName = key.split(':')[0]; rarraytypeMap[keyName] = jsonObj[key]; } + if (key.lastIndexOf(':comment') >= 0) { + const keyName = key.split(':')[0]; + commentMap[keyName] = jsonObj[key]; + } + if (key.lastIndexOf(':hint') >= 0) { + const keyName = key.split(':')[0]; + hintMap[keyName] = jsonObj[key]; + } + } else { + if (key == ':class:comment') { + const tmpKeyName = jsonObj[':class']; + clsCommentMap[tmpKeyName] = jsonObj[key]; + } } } @@ -374,6 +444,9 @@ const analyzeJson = (jsonObj: any | any[], if (requireMap[key]) { result.childList[key].setRequired(requireMap[key]); } + if (commentMap[key]) { + result.childList[key].setComment(commentMap[key], hintMap[key]); + } const tempChild = analyzeJson(value, key, rarraytypeMap[key]); if (tempChild) { if (result.childList[key].type == '') { @@ -384,6 +457,7 @@ const analyzeJson = (jsonObj: any | any[], result.childList[key].isArray = true; } else { result.childList[key].isObject = true; + result.childList[key].classComment = tempChild.classComment; } } result.childList[key].childList = tempChild.childList; @@ -1292,11 +1366,12 @@ const generateStructHeader = (dirname: string, filename: string, // generate typescript data file function // ---------------------------------------------------------------------------- const generateTsData = (dirname: string, filename: string, - jsonClassMap: ClassMapType, jsonTypeList: any[], + jsonClassMap: ClassMapType, jsonTypeList: ClassParameterType[], functionList: string | any[], loadCfdjsIndexFile: fs.PathLike, promiseMode: boolean, tsClassName: string, insertFunctions: TsAppendFunctionData[], - insertErrorFunctions: TsAppendFunctionData[]) => { + insertErrorFunctions: TsAppendFunctionData[], + functionCommentMap: ClassCommentMapType) => { let outPath = `${dirname}/${filename}`; if (outPath.startsWith(__dirname)) { outPath = outPath.substr(__dirname.length); @@ -1307,6 +1382,10 @@ const generateTsData = (dirname: string, filename: string, while (outPath.indexOf('//') >= 0) { outPath = outPath.replace('//', '/'); } + const classCommentMap: {[key: string]: string} = {}; + for (const typeData of jsonTypeList) { + classCommentMap[typeData.name] = typeData.comment; + } // initialize const project = new Project({ @@ -1333,17 +1412,30 @@ const generateTsData = (dirname: string, filename: string, } } else { file.insertStatements(0, '/* eslint-disable max-len */'); - file.insertStatements(1, '/* eslint-disable require-jsdoc */'); + file.insertStatements(1, '/* eslint-disable indent */'); } for (let i = 0; i < jsonTypeList.length; ++i) { - const clsName = jsonTypeList[i]; - const props = jsonClassMap[clsName]; + const clsName = jsonTypeList[i].name; + const comment = jsonTypeList[i].comment || classCommentMap[clsName]; + const props: ParameterType[] = jsonClassMap[clsName]; + const tags = []; + for (const prop of props) { + if (prop && prop.comment) { + const type = prop.type; + const name = prop.name; + tags.push({tagName: 'property', text: `\{${type}\} ${name} - ${prop.comment}`}); + } + } debugLog(`${clsName} = `, props); file.addInterface({ name: clsName, isExported: true, properties: props, + docs: [{ + description: comment, + tags, + }], }); } @@ -1352,29 +1444,46 @@ const generateTsData = (dirname: string, filename: string, classObj = file.addClass({ name: tsClassName, isExported: true, + docs: [{ + description: 'function definition class.', + }], }); } for (let i = 0; i < functionList.length; ++i) { // manipulate const funcName = functionList[i]; + const funcComment = functionCommentMap[funcName] || ''; const reqName = `${funcName}Request`; const resName = `${funcName}Response`; const resDataName = (promiseMode) ? `Promise<${resName}>` : resName; const params = (reqName in jsonClassMap) ? [{name: 'jsonObject', type: reqName}] : []; const retType = (resName in jsonClassMap) ? resDataName : undefined; + const inputDoc = {tagName: 'param', text: `\{${reqName}\} - request data.`}; + const returnDoc = {tagName: 'return', text: `\{${retType}\} - response data.`}; + const tags = []; + if (reqName in jsonClassMap) tags.push(inputDoc); + if (resName in jsonClassMap) tags.push(returnDoc); if (classObj === undefined) { file.addFunction({ name: funcName, isExported: true, parameters: params, returnType: retType, + docs: [{ + description: funcComment, + tags, + }], }); } else { classObj.addMethod({ name: funcName, parameters: params, returnType: retType, + docs: [{ + description: funcComment, + tags, + }], }); } } @@ -1383,33 +1492,69 @@ const generateTsData = (dirname: string, filename: string, const funcName = insertFunctions[i].name; const params = insertFunctions[i].parameters; const retType = insertFunctions[i].returnType; + const comment = insertFunctions[i].comment; + const tags = []; + for (const prop of params) { + if (prop && prop.comment) { + const type = prop.type; + const name = prop.name; + tags.push({tagName: 'param', text: `\{${type}\} ${name} - ${prop.comment}`}); + } + } file.addFunction({ name: funcName, isExported: true, parameters: params, returnType: retType, + docs: [{ + description: comment, + tags, + }], }); } const errorClassObj = file.addClass({ name: 'CfdError', isExported: true, + docs: [{ + description: 'error class.', + }], }); errorClassObj.setExtends('Error'); for (let i = 0; i < insertErrorFunctions.length; ++i) { const funcName = insertErrorFunctions[i].name; const params = insertErrorFunctions[i].parameters; const retType = insertErrorFunctions[i].returnType; + const comment = insertErrorFunctions[i].comment; + const tags = []; + for (const prop of params) { + if (prop) { + const type = prop.type; + const name = prop.name; + tags.push({tagName: 'param', text: `\{${type}\} ${name} - ${prop.comment}`}); + } + } if (funcName == 'constructor') { errorClassObj.addConstructor({ parameters: params, returnType: retType, + docs: [{ + description: 'constructor.', + tags, + }], }); } else { + if (retType) { + tags.push({tagName: 'return', text: `\{${retType}\} - ${retType} data.`}); + } errorClassObj.addMethod({ name: funcName, parameters: params, returnType: retType, + docs: [{ + description: comment, + tags, + }], }); } } @@ -1442,8 +1587,9 @@ function convertFile() { const classSourceList: string[] = []; const jsonDataList: JsonData[] = []; let jsonClassMap: ClassMapType = {}; - let jsonTypeList: any[] = []; + let jsonTypeList: ClassParameterType[] = []; const functionList: string[] = []; + const functionCommentMap: ClassCommentMapType = {}; const promiseMode = false; const tsClassName = ''; const insertFunctions: TsAppendFunctionData[] = []; @@ -1452,26 +1598,33 @@ function convertFile() { parameters: [{ name: 'message', type: 'string', + comment: 'Error message.', }, { name: 'errorInformation', type: 'InnerErrorResponse', + comment: 'Error information data.', }, { name: 'cause', type: 'Error', + comment: 'Cause of the error.', }], returnType: 'void', + comment: 'constructor.', }, { name: 'toString', parameters: [], returnType: 'string', + comment: 'get error string.', }, { name: 'getErrorInformation', parameters: [], returnType: 'InnerErrorResponse', + comment: 'get error information.', }, { name: 'getCause', parameters: [], returnType: 'Error', + comment: 'get error cause.', }]; if (fs.existsSync(cfdPath) && fs.statSync(cfdPath).isDirectory()) { @@ -1516,7 +1669,12 @@ function convertFile() { jsonTypeList = ret['list']; if (funcName === '') funcName = resData.getFunctionName(); } - if (funcName !== '') functionList.push(funcName); + if (funcName !== '') { + functionList.push(funcName); + if (jsonObject.comment) { + functionCommentMap[funcName] = jsonObject.comment; + } + } debugLog(`reqData = ${reqData}`); debugLog(`resData = ${resData}`); jsonDataList.push(new JsonData(jsonObject, reqData, resData)); @@ -1577,7 +1735,8 @@ function convertFile() { } generateTsData(outTsFolderPath, outTsFileName, jsonClassMap, jsonTypeList, functionList, loadCfdjsIndexFile, promiseMode, - tsClassName, insertFunctions, insertErrorFunctions); + tsClassName, insertFunctions, insertErrorFunctions, + functionCommentMap); } }); }; diff --git a/wrap_js/__test__/EstimateFee.spec.js b/wrap_js/__test__/EstimateFee.spec.js index ba2dff0f..0b95805f 100644 --- a/wrap_js/__test__/EstimateFee.spec.js +++ b/wrap_js/__test__/EstimateFee.spec.js @@ -59,7 +59,7 @@ const testCase = [ tx: '02000000000000000000', isElements: false, })], - '{\"feeAmount\":100,\"txFeeAmount\":10,\"utxoFeeAmount\":90}', + '{\"feeAmount\":100,\"txFeeAmount\":10,\"txoutFeeAmount\":10,\"utxoFeeAmount\":90}', ); })(), (() => { @@ -73,7 +73,7 @@ const testCase = [ tx: '02000000000000000000', isElements: false, })], - '{\"feeAmount\":280,\"txFeeAmount\":10,\"utxoFeeAmount\":270}', + '{\"feeAmount\":280,\"txFeeAmount\":10,\"txoutFeeAmount\":10,\"utxoFeeAmount\":270}', ); })(), (() => { @@ -87,7 +87,7 @@ const testCase = [ tx: '02000000014cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff0101000000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000', isElements: false, })], - '{\"feeAmount\":143,\"txFeeAmount\":53,\"utxoFeeAmount\":90}', + '{\"feeAmount\":143,\"txFeeAmount\":53,\"txoutFeeAmount\":53,\"utxoFeeAmount\":90}', ); })(), (() => { @@ -101,7 +101,7 @@ const testCase = [ tx: '02000000034cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20100000000ffffffff030200000000000000220020c5ae4ff17cec055e964b573601328f3f879fa441e53ef88acdfd4d8e8df429ef406f400100000000220020ea5a7208cddfbc20dd93e12bf29deb00b68c056382a502446c9c5b55490954d215cd5b0700000000220020f39f6272ba6b57918eb047c5dc44fb475356b0f24c12fca39b19284e80008a4200000000', isElements: false, })], - '{\"feeAmount\":319,\"txFeeAmount\":139,\"utxoFeeAmount\":180}', + '{\"feeAmount\":319,\"txFeeAmount\":139,\"txoutFeeAmount\":139,\"utxoFeeAmount\":180}', ); })(), (() => { @@ -115,7 +115,7 @@ const testCase = [ tx: '02000000014cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff0101000000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000', isElements: false, })], - '{\"feeAmount\":2860,\"txFeeAmount\":1060,\"utxoFeeAmount\":1800}', + '{\"feeAmount\":2860,\"txFeeAmount\":1060,\"txoutFeeAmount\":1060,\"utxoFeeAmount\":1800}', ); })(), (() => { @@ -129,7 +129,7 @@ const testCase = [ tx: '02000000034cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20100000000ffffffff030200000000000000220020c5ae4ff17cec055e964b573601328f3f879fa441e53ef88acdfd4d8e8df429ef406f400100000000220020ea5a7208cddfbc20dd93e12bf29deb00b68c056382a502446c9c5b55490954d215cd5b0700000000220020f39f6272ba6b57918eb047c5dc44fb475356b0f24c12fca39b19284e80008a4200000000', isElements: false, })], - '{\"feeAmount\":6380,\"txFeeAmount\":2780,\"utxoFeeAmount\":3600}', + '{\"feeAmount\":6380,\"txFeeAmount\":2780,\"txoutFeeAmount\":2780,\"utxoFeeAmount\":3600}', ); })(), (() => { @@ -143,7 +143,7 @@ const testCase = [ tx: '02000000014cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff0101000000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000', isElements: false, })], - '{\"feeAmount\":121,\"txFeeAmount\":53,\"utxoFeeAmount\":68}', + '{\"feeAmount\":121,\"txFeeAmount\":53,\"txoutFeeAmount\":53,\"utxoFeeAmount\":68}', ); })(), (() => { @@ -157,7 +157,7 @@ const testCase = [ tx: '02000000034cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20100000000ffffffff030200000000000000220020c5ae4ff17cec055e964b573601328f3f879fa441e53ef88acdfd4d8e8df429ef406f400100000000220020ea5a7208cddfbc20dd93e12bf29deb00b68c056382a502446c9c5b55490954d215cd5b0700000000220020f39f6272ba6b57918eb047c5dc44fb475356b0f24c12fca39b19284e80008a4200000000', isElements: false, })], - '{\"feeAmount\":275,\"txFeeAmount\":139,\"utxoFeeAmount\":136}', + '{\"feeAmount\":275,\"txFeeAmount\":139,\"txoutFeeAmount\":139,\"utxoFeeAmount\":136}', ); })(), (() => { @@ -171,7 +171,7 @@ const testCase = [ tx: '02000000014cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff0101000000000000002200201863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200000000', isElements: false, })], - '{\"feeAmount\":131,\"txFeeAmount\":53,\"utxoFeeAmount\":78}', + '{\"feeAmount\":131,\"txFeeAmount\":53,\"txoutFeeAmount\":53,\"utxoFeeAmount\":78}', ); })(), (() => { @@ -185,7 +185,7 @@ const testCase = [ tx: '02000000034cdeada737db97af334f0fa4e87432d6068759eea65a3067d1f14a979e5a9dea0000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20000000000ffffffff81ddd34c6c0c32544e3b89f5e24c6cd7afca62f2b5069281ac9fced6251191d20100000000ffffffff030200000000000000220020c5ae4ff17cec055e964b573601328f3f879fa441e53ef88acdfd4d8e8df429ef406f400100000000220020ea5a7208cddfbc20dd93e12bf29deb00b68c056382a502446c9c5b55490954d215cd5b0700000000220020f39f6272ba6b57918eb047c5dc44fb475356b0f24c12fca39b19284e80008a4200000000', isElements: false, })], - '{\"feeAmount\":295,\"txFeeAmount\":139,\"utxoFeeAmount\":156}', + '{\"feeAmount\":295,\"txFeeAmount\":139,\"txoutFeeAmount\":139,\"utxoFeeAmount\":156}', ); })(), ]; @@ -220,7 +220,7 @@ const elementsTestCase = [ isElements: true, feeAsset: FEE_ASSET, })], - '{\"feeAmount\":147,\"txFeeAmount\":56,\"utxoFeeAmount\":91}', + '{\"feeAmount\":147,\"txFeeAmount\":56,\"txoutFeeAmount\":56,\"utxoFeeAmount\":91}', ); })(), (() => { @@ -236,7 +236,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":329,\"txFeeAmount\":56,\"utxoFeeAmount\":273}', + '{\"feeAmount\":329,\"txFeeAmount\":56,\"txoutFeeAmount\":56,\"utxoFeeAmount\":273}', ); })(), (() => { @@ -252,7 +252,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":1012,\"txFeeAmount\":921,\"utxoFeeAmount\":91}', + '{\"feeAmount\":1012,\"txFeeAmount\":921,\"txoutFeeAmount\":921,\"utxoFeeAmount\":91}', ); })(), (() => { @@ -268,7 +268,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":1984,\"txFeeAmount\":1802,\"utxoFeeAmount\":182}', + '{\"feeAmount\":1984,\"txFeeAmount\":1802,\"txoutFeeAmount\":1802,\"utxoFeeAmount\":182}', ); })(), (() => { @@ -284,7 +284,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":20240,\"txFeeAmount\":18420,\"utxoFeeAmount\":1820}', + '{\"feeAmount\":20240,\"txFeeAmount\":18420,\"txoutFeeAmount\":18420,\"utxoFeeAmount\":1820}', ); })(), (() => { @@ -300,7 +300,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":39680,\"txFeeAmount\":36040,\"utxoFeeAmount\":3640}', + '{\"feeAmount\":39680,\"txFeeAmount\":36040,\"txoutFeeAmount\":36040,\"utxoFeeAmount\":3640}', ); })(), (() => { @@ -316,7 +316,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":990,\"txFeeAmount\":921,\"utxoFeeAmount\":69}', + '{\"feeAmount\":990,\"txFeeAmount\":921,\"txoutFeeAmount\":921,\"utxoFeeAmount\":69}', ); })(), (() => { @@ -332,7 +332,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, minimumBits: 36, })], - '{\"feeAmount\":1940,\"txFeeAmount\":1802,\"utxoFeeAmount\":138}', + '{\"feeAmount\":1940,\"txFeeAmount\":1802,\"txoutFeeAmount\":1802,\"utxoFeeAmount\":138}', ); })(), (() => { @@ -347,7 +347,7 @@ const elementsTestCase = [ isElements: true, feeAsset: FEE_ASSET, })], - '{\"feeAmount\":1320,\"txFeeAmount\":1241,\"utxoFeeAmount\":79}', + '{\"feeAmount\":1320,\"txFeeAmount\":1241,\"txoutFeeAmount\":1241,\"utxoFeeAmount\":79}', ); })(), (() => { @@ -362,7 +362,7 @@ const elementsTestCase = [ isElements: true, feeAsset: FEE_ASSET, })], - '{\"feeAmount\":2600,\"txFeeAmount\":2442,\"utxoFeeAmount\":158}', + '{\"feeAmount\":2600,\"txFeeAmount\":2442,\"txoutFeeAmount\":2442,\"utxoFeeAmount\":158}', ); })(), (() => { @@ -378,7 +378,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, isBlind: false, })], - '{\"feeAmount\":216,\"txFeeAmount\":125,\"utxoFeeAmount\":91}', + '{\"feeAmount\":216,\"txFeeAmount\":125,\"txoutFeeAmount\":125,\"utxoFeeAmount\":91}', ); })(), (() => { @@ -394,7 +394,7 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, isBlind: false, })], - '{\"feeAmount\":1501,\"txFeeAmount\":1319,\"utxoFeeAmount\":182}', + '{\"feeAmount\":1501,\"txFeeAmount\":1319,\"txoutFeeAmount\":1319,\"utxoFeeAmount\":182}', ); })(), (() => { @@ -418,7 +418,7 @@ const elementsTestCase = [ feeAsset: '017981c1f171d7973a1fd922652f559f47d6d1506a4be2394b27a54951957f6c18', minimumBits: 36, })], - '{\"feeAmount\":4364,\"txFeeAmount\":2697,\"utxoFeeAmount\":1667}', + '{\"feeAmount\":4364,\"txFeeAmount\":2697,\"txoutFeeAmount\":2697,\"utxoFeeAmount\":1667}', ); })(), (() => { @@ -443,7 +443,32 @@ const elementsTestCase = [ feeAsset: FEE_ASSET, isBlind: false, })], - '{\"feeAmount\":1513,\"txFeeAmount\":1311,\"utxoFeeAmount\":202}', + '{\"feeAmount\":1513,\"txFeeAmount\":1311,\"txoutFeeAmount\":1311,\"utxoFeeAmount\":202}', + ); + })(), + (() => { + const selectUtxos = [{ + txid: '1234567890123456789012345678901234567890123456789012345678901234', + vout: 0, + amount: 600000000, + asset: DEFAULT_ASSET, + descriptor: FIXED_DESCRIPTOR, + isPegin: true, + peginBtcTxSize: 210, + fedpegScript: '51', + }]; + return TestHelper.createElementsTestCase( + 'EstimateFee Elements - 13[6,7]coins-pegin, tx: 2 output, feeRate: 0.1', + EstimateFee, + [JSON.stringify({ + selectUtxos, + feeRate: 0.1, + tx: '020000000002d4b91f8ea0be3d89d33f9588884a843e78688152f4dff8aca5abc6f5973a83ae0000000000feffffff140510708ffd1fc8bea09e204d36b0d5b9402a31767a4f6c36f23b40cd0cbaf70a00000000faffffff0301f38611eb688e6fcd06f25e2faf52b9f98364dc14c379ab085f1b57d56b4b1a6f01000000003b9328e0001976a9146d715ab3da8090fd8f9e7aada1588e531b16b7da88ac0151f799a22a9375b31c2f20edce025f0df5231306e81222a0061bde342dc447ef010000000008f0d1800255fb6295bfd3bbf4760776a59d9476fac2e52f9c0c16549aea5c2ca5f1c15e6f1976a9147cafacbfc72f3682b1055b3a6b8711f3622eabfd88ac01f38611eb688e6fcd06f25e2faf52b9f98364dc14c379ab085f1b57d56b4b1a6f01000000000007a120000090000000', + isElements: true, + feeAsset: FEE_ASSET, + isBlind: false, + })], + '{\"feeAmount\":153,\"txFeeAmount\":132,\"txoutFeeAmount\":132,\"utxoFeeAmount\":21}', ); })(), ]; diff --git a/wrap_js/__test__/FundRawTransaction.spec.js b/wrap_js/__test__/FundRawTransaction.spec.js index 36b17fd4..5314a44e 100644 --- a/wrap_js/__test__/FundRawTransaction.spec.js +++ b/wrap_js/__test__/FundRawTransaction.spec.js @@ -729,6 +729,36 @@ const elementsTestCase = [ '{"hex":"02000000000100000002000000000000000000000000000000000000000000000000000000000000000000ffffffff0201efcdabefcdabcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdab010000000000000131000001efcdabefcdabcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdab0100000000001e834f0017a9141b3407a0be5d01401fae0ddfc3af014758f3aed48700000000","usedAddresses":["XDq5RRCBNnqgvWVUzKycmmo3dPnxWP6y5h"],"feeAmount":305}', ); })(), + (() => { + const utxoSetA = TestUtxoCreater.createUtxos([0.1, 0.2, 0.3, 0.4, 0.5], FIXED_DESCRIPTOR, DEFAULT_ASSET_A); + const utxoSetB = TestUtxoCreater.createUtxos([0.6, 0.7, 0.8, 0.9, 1.0], SEGWIT_DESCRIPTOR, DEFAULT_ASSET_B); + const utxosForFee = TestUtxoCreater.createUtxos([0.01, 0.02, 0.03, 0.04, 0.05], FIXED_DESCRIPTOR, FEE_ASSET); + const utxos = [].concat(utxoSetA, utxoSetB, utxosForFee); + return TestHelper.createElementsTestCase( + 'FundRawTransaction - Elements - (tx: 0 input 0 output, targetAmount: 0, feeRate: 0.1)', + FundRawTransaction, + [JSON.stringify({ + utxos, + tx: '0200000000000000000000', + isElements: true, + network: 'regtest', + targets: [{ + asset: FEE_ASSET, + amount: 0, + reserveAddress: 'XDq5RRCBNnqgvWVUzKycmmo3dPnxWP6y5h', + }], + feeInfo: { + feeRate: 0.1, + longTermFeeRate: 0.1, + knapsackMinChange: -1, + dustFeeRate: 0.1, + feeAsset: FEE_ASSET, + isBlindEstimateFee: false, + }, + })], + '{"hex":"02000000000100000002000000000000000000000000000000000000000000000000000000000000000000ffffffff0201efcdabefcdabcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdab010000000000000021000001efcdabefcdabcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdabefcdab0100000000001e845f0017a9141b3407a0be5d01401fae0ddfc3af014758f3aed48700000000","usedAddresses":["XDq5RRCBNnqgvWVUzKycmmo3dPnxWP6y5h"],"feeAmount":33}', + ); + })(), (() => { const utxoSetA = TestUtxoCreater.createUtxos([0.1, 0.2, 0.3, 0.4, 0.5], FIXED_DESCRIPTOR, DEFAULT_ASSET_A); const utxoSetB = TestUtxoCreater.createUtxos([0.6, 0.7, 0.8, 0.9, 1.0], SEGWIT_DESCRIPTOR, DEFAULT_ASSET_B);