cfdgo

package module
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 6 Imported by: 0

README

Crypto Finance Development Kit for Go (CFD-GO)

Dependencies

  • Go (1.12 or higher)
  • C/C++ Compiler   - can compilefe c++11
    • make support compiler
  • CMake (3.14.3 or higher)
  • Python 3.x
  • node.js (stable version)
    • for cmake-js
Windows (MinGW)

attention: Cgo can only be used on the make platform.

(Recommended to use wsl(Windows Subsystem for Linux), because it can be cumbersome.)

MacOS
# xcode cli tools
xcode-select --install

# install dependencies using Homebrew
brew install cmake go node
Linux(Ubuntu)
# install dependencies using APT package Manager
apt-get install -y build-essential golang cmake nodejs

cmake version 3.14.2 or lower, download from website and install cmake. (https://cmake.org/download/)

go version 1.11 or lower, get golang.org/dl/go1.13 or higher. (https://www.mazn.net/blog/2019/02/03/1704.html)


Build

Using cmake-js

(If you want to install, see the installation. Introduces build and install command.)

When using the cmake-js package and npm script, the options for compilation are already set.

npm install
npm run cmake_release
go build
Using CMake
# recommend out of source build
mkdir build && cd $_
# configure & build
cmake .. -DENABLE_SHARED=on -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=off -DENABLE_JS_WRAPPER=off -DENABLE_CAPI=on -DTARGET_RPATH=/usr/local/lib/
make
cd ..
go build

CMake options

cmake .. (CMake options) -DENABLE_JS_WRAPPER=off

  • -DENABLE_ELEMENTS: Enable functionalies for elements sidechain. [ON/OFF] (default:ON)
  • -DENABLE_SHARED: Enable building a shared library. [ON/OFF] (default:OFF)
  • -DENABLE_TESTS: Enable building a testing codes. If enables this option, builds testing framework submodules(google test) automatically. [ON/OFF] (default:ON)
  • -DCMAKE_BUILD_TYPE=Release: Enable release build.
  • -DCMAKE_BUILD_TYPE=Debug: Enable debug build.
  • -DCFDCORE_DEBUG=on: Enable cfd debug mode and loggings log files. [ON/OFF] (default:OFF)

install / uninstall

On Linux or MacOS, can use install / uninstall.

install (after build)

install for /usr/local/lib.

Using cmake-js install

When using the cmake-js package and npm script, the options for compilation are already set.

Attention: Currently, there is a problem with ExternalProject, so a problem occurs when performing update processing. Please perform cleanup when building before installation.

(cleanup)
./tools/cmake_cleanup.sh
sudo ./tools/cleanup_install_files.sh

(build and install by using makefile)
npm run cmake_make_install
(Enter the password when prompted to use the sudo command.)

cmake version is 3.15 or higher:

(cleanup)
./tools/cmake_cleanup.sh
sudo ./tools/cleanup_install_files.sh

(build and install by using ninja or makefile)
npm run cmake_install
(Enter the password when prompted to use the sudo command.)
Using CMake install

Attention: Currently, there is a problem with ExternalProject, so a problem occurs when performing update processing. Please perform cleanup when building before installation.

(cleanup)
./tools/cmake_cleanup.sh
sudo ./tools/cleanup_install_files.sh

(build)
mkdir build && cd build && cmake .. -DENABLE_SHARED=on -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=off -DENABLE_JS_WRAPPER=off -DENABLE_CAPI=on -DTARGET_RPATH=/usr/local/lib && make

(install by using makefile)
cd build && sudo make install

(install by using ninja)
cd build && sudo ninja install

cmake version is 3.15 or higher: cmake --install build

uninstall
(uninstall by using makefile)
cd build && sudo make uninstall

(uninstall by using ninja)
cd build && sudo ninja uninstall

(uninstall by using script)
sudo ./tools/cleanup_install_files.sh

How to use cfd-go as go module

  1. Once, clone this repository.
  2. Build & install cfd-go(and dependencies).
  3. Modify go.mod file adding cfd-go as go moudle

go.mod

require (
  github.com/cryptogarageinc/cfd-go v0.0.2
  ...
)

Reference github commit:

require (
  github.com/cryptogarageinc/cfd-go v1.0.0-0.20191205091101-a48a6a8b1a24
  ...
)

(version format: UnknownVersionTag-UtcDate-CommitHash)

  1. Download cfd-go module
go mod download

Example

Test
LD_LIBRARY_PATH=./build/Release go test
Example
  • cfdgo_test.go

Note

Git connection:

Git repository connections default to HTTPS. However, depending on the connection settings of GitHub, you may only be able to connect via SSH. As a countermeasure, forcibly establish SSH connection by setting CFD_CMAKE_GIT_SSH=1 in the environment variable.

  • Windows: (On the command line. Or set from the system setting screen.)
set CFD_CMAKE_GIT_SSH=1
  • MacOS & Linux(Ubuntu):
export CFD_CMAKE_GIT_SSH=1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Swig_escape_always_false bool
View Source
var Swig_escape_val interface{}

Functions

func CfdAddBlindTxInData

func CfdAddBlindTxInData(arg1 uintptr, arg2 uintptr, arg3 string, arg4 Uint32_t, arg5 string, arg6 string, arg7 string, arg8 Int64_t, arg9 string, arg10 string) (_swig_ret int)

func CfdAddBlindTxOutData

func CfdAddBlindTxOutData(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 string) (_swig_ret int)

func CfdAddCoinSelectionAmount

func CfdAddCoinSelectionAmount(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 Int64_t, arg5 string) (_swig_ret int)

func CfdAddCoinSelectionUtxo

func CfdAddCoinSelectionUtxo(arg1 uintptr, arg2 uintptr, arg3 Int32_t, arg4 string, arg5 Uint32_t, arg6 Int64_t, arg7 string, arg8 string) (_swig_ret int)

func CfdAddConfidentialTxDerSign

func CfdAddConfidentialTxDerSign(arg1 uintptr, arg2 string, arg3 string, arg4 Uint32_t, arg5 bool, arg6 string, arg7 int, arg8 bool, arg9 bool, arg10 *string) (_swig_ret int)

func CfdAddConfidentialTxIn

func CfdAddConfidentialTxIn(arg1 uintptr, arg2 string, arg3 string, arg4 Uint32_t, arg5 Uint32_t, arg6 *string) (_swig_ret int)

func CfdAddConfidentialTxOut

func CfdAddConfidentialTxOut(arg1 uintptr, arg2 string, arg3 string, arg4 Int64_t, arg5 string, arg6 string, arg7 string, arg8 string, arg9 *string) (_swig_ret int)

func CfdAddConfidentialTxSign

func CfdAddConfidentialTxSign(arg1 uintptr, arg2 string, arg3 string, arg4 Uint32_t, arg5 bool, arg6 string, arg7 bool, arg8 *string) (_swig_ret int)

func CfdAddMultisigScriptData

func CfdAddMultisigScriptData(arg1 uintptr, arg2 uintptr, arg3 string) (_swig_ret int)

func CfdAddMultisigScriptSigData

func CfdAddMultisigScriptSigData(arg1 uintptr, arg2 uintptr, arg3 string, arg4 string) (_swig_ret int)

func CfdAddMultisigScriptSigDataToDer

func CfdAddMultisigScriptSigDataToDer(arg1 uintptr, arg2 uintptr, arg3 string, arg4 int, arg5 bool, arg6 string) (_swig_ret int)

func CfdAddMultisigSignData

func CfdAddMultisigSignData(arg1 uintptr, arg2 uintptr, arg3 string, arg4 string) (_swig_ret int)

func CfdAddMultisigSignDataToDer

func CfdAddMultisigSignDataToDer(arg1 uintptr, arg2 uintptr, arg3 string, arg4 int, arg5 bool, arg6 string) (_swig_ret int)

func CfdAddTxInForEstimateFee

func CfdAddTxInForEstimateFee(arg1 uintptr, arg2 uintptr, arg3 string, arg4 Uint32_t, arg5 string, arg6 string, arg7 bool, arg8 bool, arg9 bool, arg10 Uint32_t, arg11 string) (_swig_ret int)

func CfdCalculateEcSignature

func CfdCalculateEcSignature(arg1 uintptr, arg2 string, arg3 string, arg4 string, arg5 int, arg6 bool, arg7 *string) (_swig_ret int)

func CfdCloneHandle

func CfdCloneHandle(arg1 uintptr, arg2 *uintptr) (_swig_ret int)

func CfdConvertScriptAsmToHex

func CfdConvertScriptAsmToHex(arg1 uintptr, arg2 string, arg3 *string) (_swig_ret int)

func CfdCopyErrorState

func CfdCopyErrorState(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdCreateAddress

func CfdCreateAddress(arg1 uintptr, arg2 int, arg3 string, arg4 string, arg5 int, arg6 *string, arg7 *string, arg8 *string) (_swig_ret int)

func CfdCreateConfidentialAddress

func CfdCreateConfidentialAddress(arg1 uintptr, arg2 string, arg3 string, arg4 *string) (_swig_ret int)

func CfdCreateConfidentialSighash

func CfdCreateConfidentialSighash(arg1 uintptr, arg2 string, arg3 string, arg4 Uint32_t, arg5 int, arg6 string, arg7 string, arg8 Int64_t, arg9 string, arg10 int, arg11 bool, arg12 *string) (_swig_ret int)

func CfdCreateExtPubkey

func CfdCreateExtPubkey(arg1 uintptr, arg2 string, arg3 int, arg4 *string) (_swig_ret int)

func CfdCreateExtkeyFromParentPath

func CfdCreateExtkeyFromParentPath(arg1 uintptr, arg2 string, arg3 string, arg4 int, arg5 int, arg6 *string) (_swig_ret int)

func CfdCreateExtkeyFromSeed

func CfdCreateExtkeyFromSeed(arg1 uintptr, arg2 string, arg3 int, arg4 int, arg5 *string) (_swig_ret int)

func CfdCreateHandle

func CfdCreateHandle(arg1 *uintptr) (_swig_ret int)

func CfdCreateKeyPair

func CfdCreateKeyPair(arg1 uintptr, arg2 bool, arg3 int, arg4 *string, arg5 *string, arg6 *string) (_swig_ret int)

func CfdCreateSimpleHandle

func CfdCreateSimpleHandle(arg1 *uintptr) (_swig_ret int)

func CfdEncodeSignatureByDer

func CfdEncodeSignatureByDer(arg1 uintptr, arg2 string, arg3 int, arg4 bool, arg5 *string) (_swig_ret int)

func CfdFinalize

func CfdFinalize(arg1 bool) (_swig_ret int)

func CfdFinalizeBlindTx

func CfdFinalizeBlindTx(arg1 uintptr, arg2 uintptr, arg3 string, arg4 *string) (_swig_ret int)

func CfdFinalizeCoinSelection

func CfdFinalizeCoinSelection(arg1 uintptr, arg2 uintptr, arg3 Int64_t) (_swig_ret int)

func CfdFinalizeElementsMultisigSign

func CfdFinalizeElementsMultisigSign(arg1 uintptr, arg2 uintptr, arg3 string, arg4 string, arg5 Uint32_t, arg6 int, arg7 string, arg8 string, arg9 bool, arg10 *string) (_swig_ret int)

func CfdFinalizeEstimateFee

func CfdFinalizeEstimateFee(arg1 uintptr, arg2 uintptr, arg3 string, arg4 string, arg5 Int64_t, arg6 Int64_t, arg7 bool, arg8 float64) (_swig_ret int)

func CfdFinalizeMultisigScript

func CfdFinalizeMultisigScript(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 *string, arg5 *string, arg6 *string) (_swig_ret int)

func CfdFinalizeMultisigScriptSig

func CfdFinalizeMultisigScriptSig(arg1 uintptr, arg2 uintptr, arg3 string, arg4 *string) (_swig_ret int)

func CfdFreeAddressesMultisigHandle

func CfdFreeAddressesMultisigHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeBlindHandle

func CfdFreeBlindHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeBuffer

func CfdFreeBuffer(arg1 uintptr) (_swig_ret int)

func CfdFreeCoinSelectionHandle

func CfdFreeCoinSelectionHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeDescriptorHandle

func CfdFreeDescriptorHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeEstimateFeeHandle

func CfdFreeEstimateFeeHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeHandle

func CfdFreeHandle(arg1 uintptr) (_swig_ret int)

func CfdFreeMultisigScriptHandle

func CfdFreeMultisigScriptHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeMultisigScriptSigHandle

func CfdFreeMultisigScriptSigHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeMultisigSignHandle

func CfdFreeMultisigSignHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdFreeScriptItemHandle

func CfdFreeScriptItemHandle(arg1 uintptr, arg2 uintptr) (_swig_ret int)

func CfdGetAddressFromLockingScript

func CfdGetAddressFromLockingScript(arg1 uintptr, arg2 string, arg3 int, arg4 *string) (_swig_ret int)

func CfdGetAddressFromMultisigKey

func CfdGetAddressFromMultisigKey(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 *string, arg5 *string) (_swig_ret int)

func CfdGetAddressInfo

func CfdGetAddressInfo(arg1 uintptr, arg2 string, arg3 *int, arg4 *int, arg5 *int, arg6 *string, arg7 *string) (_swig_ret int)

func CfdGetAddressesFromMultisig

func CfdGetAddressesFromMultisig(arg1 uintptr, arg2 string, arg3 int, arg4 int, arg5 *uintptr, arg6 Uint32_t) (_swig_ret int)

func CfdGetConfidentialTxIn

func CfdGetConfidentialTxIn(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 *string, arg5 Uint32_t, arg6 Uint32_t, arg7 *string) (_swig_ret int)

func CfdGetConfidentialTxInCount

func CfdGetConfidentialTxInCount(arg1 uintptr, arg2 string, arg3 Uint32_t) (_swig_ret int)

func CfdGetConfidentialTxInWitness

func CfdGetConfidentialTxInWitness(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 Uint32_t, arg5 *string) (_swig_ret int)

func CfdGetConfidentialTxInWitnessCount

func CfdGetConfidentialTxInWitnessCount(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 Uint32_t) (_swig_ret int)

func CfdGetConfidentialTxInfo

func CfdGetConfidentialTxInfo(arg1 uintptr, arg2 string, arg3 *string, arg4 *string, arg5 *string, arg6 Uint32_t, arg7 Uint32_t, arg8 Uint32_t, arg9 Uint32_t, arg10 Uint32_t) (_swig_ret int)

func CfdGetConfidentialTxOut

func CfdGetConfidentialTxOut(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 *string, arg5 Int64_t, arg6 *string, arg7 *string, arg8 *string, arg9 *string, arg10 *string) (_swig_ret int)

func CfdGetConfidentialTxOutCount

func CfdGetConfidentialTxOutCount(arg1 uintptr, arg2 string, arg3 Uint32_t) (_swig_ret int)

func CfdGetDescriptorChecksum

func CfdGetDescriptorChecksum(arg1 uintptr, arg2 int, arg3 string, arg4 *string) (_swig_ret int)

func CfdGetDescriptorData

func CfdGetDescriptorData(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 Uint32_t, arg5 Uint32_t, arg6 *int, arg7 *string, arg8 *string, arg9 *int, arg10 *string, arg11 *int, arg12 *string, arg13 *string, arg14 *string, arg15 *bool, arg16 Uint32_t, arg17 Uint32_t) (_swig_ret int)

func CfdGetDescriptorMultisigKey

func CfdGetDescriptorMultisigKey(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 *int, arg5 *string, arg6 *string, arg7 *string) (_swig_ret int)

func CfdGetExtkeyInformation

func CfdGetExtkeyInformation(arg1 uintptr, arg2 string, arg3 *string, arg4 *string, arg5 *string, arg6 Uint32_t, arg7 Uint32_t) (_swig_ret int)

func CfdGetIssuanceBlindingKey

func CfdGetIssuanceBlindingKey(arg1 uintptr, arg2 string, arg3 string, arg4 Uint32_t, arg5 *string) (_swig_ret int)

func CfdGetLastErrorCode

func CfdGetLastErrorCode(arg1 uintptr) (_swig_ret int)

func CfdGetLastErrorMessage

func CfdGetLastErrorMessage(arg1 uintptr, arg2 *string) (_swig_ret int)

func CfdGetParentExtkeyPathData

func CfdGetParentExtkeyPathData(arg1 uintptr, arg2 string, arg3 string, arg4 int, arg5 *string, arg6 *string) (_swig_ret int)

func CfdGetPrivkeyFromExtkey

func CfdGetPrivkeyFromExtkey(arg1 uintptr, arg2 string, arg3 int, arg4 *string, arg5 *string) (_swig_ret int)

func CfdGetPrivkeyFromWif

func CfdGetPrivkeyFromWif(arg1 uintptr, arg2 string, arg3 int, arg4 *string) (_swig_ret int)

func CfdGetPrivkeyWif

func CfdGetPrivkeyWif(arg1 uintptr, arg2 string, arg3 int, arg4 bool, arg5 *string) (_swig_ret int)

func CfdGetPubkeyFromExtkey

func CfdGetPubkeyFromExtkey(arg1 uintptr, arg2 string, arg3 int, arg4 *string) (_swig_ret int)

func CfdGetPubkeyFromPrivkey

func CfdGetPubkeyFromPrivkey(arg1 uintptr, arg2 string, arg3 string, arg4 bool, arg5 *string) (_swig_ret int)

func CfdGetScriptItem

func CfdGetScriptItem(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 *string) (_swig_ret int)

func CfdGetSelectedCoinAssetAmount

func CfdGetSelectedCoinAssetAmount(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 Int64_t) (_swig_ret int)

func CfdGetSelectedCoinIndex

func CfdGetSelectedCoinIndex(arg1 uintptr, arg2 uintptr, arg3 Uint32_t, arg4 Int32_t) (_swig_ret int)

func CfdGetSupportedFunction

func CfdGetSupportedFunction(arg1 Uint64_t) (_swig_ret int)

func CfdGetTxInIssuanceInfo

func CfdGetTxInIssuanceInfo(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 *string, arg5 *string, arg6 Int64_t, arg7 *string, arg8 Int64_t, arg9 *string, arg10 *string, arg11 *string) (_swig_ret int)

func CfdGoAddBlindTxInData

func CfdGoAddBlindTxInData(handle uintptr, blindHandle uintptr, txid string, vout uint32, asset string, assetBlindFactor string, valueBlindFactor string, satoshiAmount int64, assetKey string, tokenKey string) (err error)

*

  • Add blind transaction txin data.
  • param: handle cfd handle
  • param: blindHandle blindTx handle
  • param: txid txin txid
  • param: vout txin vout
  • param: asset utxo asset
  • param: assetBlindFactor utxo asset blind factor
  • param: valueBlindFactor utxo amount blind factor
  • param: satoshiAmount utxo amount
  • param: assetKey issuance asset blinding key
  • param: tokenKey issuance token blinding key
  • return: err error

func CfdGoAddBlindTxOutData

func CfdGoAddBlindTxOutData(handle uintptr, blindHandle uintptr, index uint32, confidentialKey string) (err error)

*

  • Add blind transaction txout data.
  • param: handle cfd handle
  • param: blindHandle blindTx handle
  • param: index txout index
  • param: confidentialKey confidential key
  • return: err error

func CfdGoAddConfidentialTxDerSign

func CfdGoAddConfidentialTxDerSign(handle uintptr, txHex string, txid string, vout uint32, isWitness bool, signDataHex string, sighashType int, sighashAnyoneCanPay bool, clearStack bool) (outputTxHex string, err error)

*

  • Convert to der encode, and add sign data to confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txid txin txid
  • param: vout txin vout
  • param: isWitness insert sign data to witness stack
  • param: signDataHex sign data hex
  • param: sighashType sighash type
  • param: sighashAnyoneCanPay sighash anyone can pay flag
  • param: clearStack cleanup stack
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddConfidentialTxIn

func CfdGoAddConfidentialTxIn(handle uintptr, txHex string, txid string, vout uint32, sequence uint32) (outputTxHex string, err error)

*

  • Add txin to confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txid txid
  • param: vout vout
  • param: sequence sequence
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddConfidentialTxOut

func CfdGoAddConfidentialTxOut(handle uintptr, txHex string, asset string, satoshiAmount int64, valueCommitment string, address string, directLockingScript string, nonce string) (outputTxHex string, err error)

*

  • Add txout to confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: asset asset
  • param: satoshiAmount amount by satoshi
  • param: valueCommitment amount by commitment bytes.
  • param: address destination address
  • param: directLockingScript locking script for direct insert.
  • param: nonce confidential nonce
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddConfidentialTxSign

func CfdGoAddConfidentialTxSign(handle uintptr, txHex string, txid string, vout uint32, isWitness bool, signDataHex string, clearStack bool) (outputTxHex string, err error)

*

  • Add sign data to confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txid txin txid
  • param: vout txin vout
  • param: isWitness insert sign data to witness stack
  • param: signDataHex sign data hex
  • param: clearStack cleanup stack
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddConfidentialTxUnlockingScript

func CfdGoAddConfidentialTxUnlockingScript(handle uintptr, txHex, txid string, vout uint32, isWitness bool, unlockingScript string, clearStack bool) (outputTxHex string, err error)

*

  • Add unlocking script to confidential transaction input.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txid txin txid
  • param: vout txin vout
  • param: isWitness insert sign data to witness stack
  • param: unlockingScript unlocking script hex
  • param: clearStack cleanup stack
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddConfidentialTxUnlockingScriptByIndex

func CfdGoAddConfidentialTxUnlockingScriptByIndex(handle uintptr, txHex string, index uint32, isWitness bool, unlockingScript string, clearStack bool) (outputTxHex string, err error)

*

  • Add unlocking script to confidential transaction input by index.
  • (prototype interface)
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index input index
  • param: isWitness insert sign data to witness stack
  • param: unlockingScript unlocking script hex
  • param: clearStack cleanup stack
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddDestoryConfidentialTxOut

func CfdGoAddDestoryConfidentialTxOut(handle uintptr, txHex string, asset string, satoshiAmount int64) (outputTxHex string, err error)

*

  • Add output for destroying the specified amount of the specified asset.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: asset asset
  • param: satoshiAmount amount by satoshi
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoAddMultisigSignData

func CfdGoAddMultisigSignData(handle uintptr, multisigSignHandle uintptr, signature string, relatedPubkey string) (err error)

*

  • Add multisig sign data.
  • param: handle cfd handle
  • param: multisigSignHandle multisig sign handle
  • param: signature signature
  • param: relatedPubkey signature related pubkey
  • return: err error

func CfdGoAddMultisigSignDataToDer

func CfdGoAddMultisigSignDataToDer(handle uintptr, multisigSignHandle uintptr, signature string, sighashType int, sighashAnyoneCanPay bool, relatedPubkey string) (err error)

*

  • Convert to der encode, and add multisig sign data.
  • param: handle cfd handle
  • param: multisigSignHandle multisig sign handle
  • param: signature signature
  • param: sighashType sighash type
  • param: sighashAnyoneCanPay sighash anyone can pay flag
  • param: relatedPubkey signature related pubkey
  • return: err error

func CfdGoCalculateEcSignature

func CfdGoCalculateEcSignature(handle uintptr, sighash string, privkeyHex string, privkeyWif string, wifNetworkType int, hasGrindR bool) (signature string, err error)

*

  • Calculate ec-signature from privkey.
  • param: handle cfd handle
  • param: sighash signatufe hash
  • param: privkeyHex privkey hex (Specify either privkeyHex or privkeyWif)
  • param: privkeyWif privkey WIF (Specify either privkeyHex or privkeyWif)
  • param: wifNetworkType network type (for privkey WIF)
  • param: hasGrindR grind-r flag
  • return: signature signature
  • return: err error

func CfdGoCloneHandle

func CfdGoCloneHandle(sourceHandle uintptr) (handle uintptr, err error)

*

  • Clone cfd handle.
  • param: handle cfd source handle
  • return: handle cfd handle. release: CfdGoFreeHandle
  • return: err error struct

func CfdGoCoinSelection

func CfdGoCoinSelection(handle uintptr, utxos []CfdUtxo, targetAmounts []CfdTargetAmount, option CfdCoinSelectionOption) (selectUtxos []CfdUtxo, totalAmounts []CfdTargetAmount, utxoFee int64, err error)

*

  • Select coins.
  • param: handle cfd handle
  • param: utxos utxo array
  • param: targetAmounts target amount array
  • param: option option for coinSelection
  • return: selectUtxos select coins
  • return: totalAmounts select amount by asset
  • return: utxoFee fee by utxo
  • return: err error

func CfdGoConvertScriptAsmToHex

func CfdGoConvertScriptAsmToHex(handle uintptr, scriptAsm string) (script string, err error)

*

  • Convert script asm to hex.
  • param: handle cfd handle.
  • param: scriptAsm script assembly string.
  • return: script hex encodeed script.
  • return: err error

func CfdGoCopyAndFreeHandle

func CfdGoCopyAndFreeHandle(parentHandle uintptr, handle uintptr) (err error)

*

  • Copy and free cfd handle.
  • param: parentHandle cfd parent handle
  • param: handle cfd free handle
  • return: err error struct

func CfdGoCreateAddress

func CfdGoCreateAddress(handle uintptr, hashType int, pubkey string, redeemScript string, networkType int) (address string, lockingScript string, p2shSegwitLockingScript string, err error)

*

  • Create Address.
  • param: handle cfd handle
  • param: hashType hash type (p2pkh, p2sh, etc...)
  • param: pubkey pubkey (pubkey hash only)
  • param: redeemScript redeem script (script hash only)
  • param: networkType network type
  • return: address address string
  • return: lockingScript locking script
  • return: p2shSegwitLockingScript p2sh-segwit witness program
  • return: err error

func CfdGoCreateConfidentialAddress

func CfdGoCreateConfidentialAddress(handle uintptr, address string, confidentialKey string) (confidentialAddress string, err error)

*

  • Create confidential address.
  • param: handle cfd handle
  • param: address address
  • param: confidentialKey confidential key
  • return: confidentialAddress confidential address
  • return: err error

func CfdGoCreateConfidentialSighash

func CfdGoCreateConfidentialSighash(handle uintptr, txHex string, txid string, vout uint32, hashType int, pubkey string, redeemScript string, satoshiAmount int64, valueCommitment string, sighashType int, sighashAnyoneCanPay bool) (sighash string, err error)

*

  • Create sighash from confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txid txin txid
  • param: vout txin vout
  • param: hashType hash type
  • param: pubkey pubkey (p2pkh, p2wpkh, p2sh-p2wpkh)
  • param: redeemScript redeem script (p2Sh, p2wsh, p2sh-p2wsh)
  • param: satoshiAmount amount by satoshi
  • param: valueCommitment amount by commitment bytes.
  • param: sighashType sighash type
  • param: sighashAnyoneCanPay sighash anyone can pay flag
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoCreateExtPubkey

func CfdGoCreateExtPubkey(handle uintptr, extkey string, networkType int) (extPubkey string, err error)

*

  • Create extpubkey from extprivkey.
  • param: handle cfd handle.
  • param: extkey ext privkey.
  • param: networkType network type.
  • return: extPubkey ext pubkey.
  • return: err error

func CfdGoCreateExtkeyFromParentPath

func CfdGoCreateExtkeyFromParentPath(handle uintptr, extkey string, path string, networkType int, keyType int) (childExtkey string, err error)

*

  • Create extkey from parent path.
  • param: handle cfd handle.
  • param: extkey parent extkey.
  • param: path bip32 key path.(ex: 0/0h/0'/0)
  • param: networkType network type.
  • param: keyType extkey type.
  • return: childExtkey child extkey.
  • return: err error

func CfdGoCreateExtkeyFromSeed

func CfdGoCreateExtkeyFromSeed(handle uintptr, seed string, networkType int, keyType int) (extkey string, err error)

*

  • Create extkey from seed.
  • param: handle cfd handle.
  • param: seed seed data(hex).
  • param: networkType network type.
  • param: keyType extkey type.
  • return: extkey extkey.
  • return: err error

func CfdGoCreateHandle

func CfdGoCreateHandle() (handle uintptr, err error)

*

  • Create cfd handle.
  • return: handle cfd handle. release: CfdGoFreeHandle
  • return: err error struct

func CfdGoCreateKeyPair

func CfdGoCreateKeyPair(handle uintptr, isCompress bool, networkType int) (pubkey string, privkeyHex string, privkeyWif string, err error)

*

  • Create key pair.
  • param: handle cfd handle.
  • param: isCompress pubkey compressed.
  • param: networkType privkey wif network type.
  • return: pubkey pubkey.
  • return: privkeyHex privkey hex.
  • return: privkeyWif privkey wif.
  • return: err error

func CfdGoCreateMultisigScript

func CfdGoCreateMultisigScript(handle uintptr, networkType int, hashType int, pubkeys []string, requireNum uint32) (address string, redeemScript string, witnessScript string, err error)

*

  • Create multisig script and address.
  • param: handle cfd handle
  • param: networkType network type
  • param: hashType hash type (p2sh, p2wsh, etc...)
  • param: pubkeys pubkey list (max 15 key)
  • param: requireNum pubkey require signature
  • return: address address string
  • return: redeemScript redeem script
  • return: witnessScript witness script
  • return: err error

func CfdGoCreateMultisigScriptSig

func CfdGoCreateMultisigScriptSig(handle uintptr, signItems []CfdMultisigSignData, redeemScript string) (scriptsig string, err error)

*

  • Create multisig scriptsig.
  • param: handle cfd handle.
  • param: signItems array of multisig sign data struct.
  • param: redeemScript hex encoded multisig script.
  • return: scriptsig hex encoded script.
  • return: err error

func CfdGoCreateScript

func CfdGoCreateScript(handle uintptr, scriptItems []string) (script string, err error)

*

  • Create script from script items.
  • param: handle cfd handle.
  • param: scriptItems array of script element string.
  • return: script hex encoded script.
  • return: err error

func CfdGoEncodeSignatureByDer

func CfdGoEncodeSignatureByDer(handle uintptr, signature string, sighashType int, sighash_anyone_can_pay bool) (derSignature string, err error)

*

  • Encode ec signature by der encoding.
  • param: handle cfd handle.
  • param: signature compact format signature.
  • param: sighashType sighash type.
  • param: sighash_anyone_can_pay flag of signing only the current input.
  • return: derSignature signature encoded by der encodeing.
  • return: err error

func CfdGoEstimateFee

func CfdGoEstimateFee(handle uintptr, txHex string, inputs []CfdEstimateFeeInput, option CfdEstimateFeeOption) (totalFee, txFee, inputFee int64, err error)

*

  • Estimate fee amount.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: inputs inputs to set in the transaction
  • param: option options for fee estimation
  • return: totalFee total fee value when all utxos set to input.
  • (totalFee = txFee + utxoFee)
  • return: txFee base transaction fee value.
  • return: inputFee fee value all of input set.

func CfdGoFinalizeBlindTx

func CfdGoFinalizeBlindTx(handle uintptr, blindHandle uintptr, txHex string) (outputTxHex string, err error)

*

  • Generate blind transaction.
  • param: handle cfd handle
  • param: blindHandle blindTx handle
  • param: txHex transaction hex
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoFinalizeElementsMultisigSign

func CfdGoFinalizeElementsMultisigSign(handle uintptr, multiSignHandle uintptr, txHex string, txid string, vout uint32, hashType int, witnessScript string, redeemScript string, clearStack bool) (outputTxHex string, err error)

*

  • Add multisig sign data to confidential transaction.
  • param: handle cfd handle
  • param: multiSignHandle multisig sign handle
  • param: txHex transaction hex
  • param: txid txin txid
  • param: vout txin vout
  • param: hashType hash type
  • param: witnessScript witness script (p2wsh, p2sh-p2wsh)
  • param: redeemScript redeem script (p2sh, p2sh-p2wsh)
  • param: clearStack cleanup stack
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoFreeBlindHandle

func CfdGoFreeBlindHandle(handle uintptr, blindHandle uintptr) (err error)

*

  • Free blind handle.
  • param: handle cfd handle
  • param: blindHandle blindTx handle
  • return: err error

func CfdGoFreeHandle

func CfdGoFreeHandle(handle uintptr) (err error)

*

  • Free cfd handle.
  • param: handle cfd handle
  • return: err error struct

func CfdGoFreeMultisigSignHandle

func CfdGoFreeMultisigSignHandle(handle uintptr, multisigSignHandle uintptr) (err error)

*

  • Free multisig sign handle.
  • param: handle cfd handle
  • param: multisigSignHandle multisig sign handle
  • return: err error

func CfdGoGetAddressFromLockingScript

func CfdGoGetAddressFromLockingScript(handle uintptr, lockingScript string, networkType int) (address string, err error)

*

  • Get address from locking script.
  • param: handle cfd handle
  • param: lockingScript locking script
  • param: networkType network type
  • param: hashType hash type (p2sh, p2wsh, etc...)
  • return: address address
  • return: err error

func CfdGoGetAddressesFromMultisig

func CfdGoGetAddressesFromMultisig(handle uintptr, redeemScript string, networkType int, hashType int) (addressList []string, pubkeyList []string, err error)

*

  • Get multisig pubkeys address.
  • param: handle cfd handle
  • param: redeemScript multisig script
  • param: networkType network type
  • param: hashType hash type (p2sh, p2wsh, etc...)
  • return: addressList address list
  • return: pubkeyList pubkey list
  • return: err error

func CfdGoGetConfidentialTxIn

func CfdGoGetConfidentialTxIn(handle uintptr, txHex string, index uint32) (txid string, vout uint32, sequence uint32, scriptSig string, err error)

*

  • Get txin on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index txin index
  • return: txid txid
  • return: vout vout
  • return: sequence sequence
  • return: scriptSig unlockingScript
  • return: err error

func CfdGoGetConfidentialTxInCount

func CfdGoGetConfidentialTxInCount(handle uintptr, txHex string) (count uint32, err error)

*

  • Get txin count on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • return: count txin count
  • return: err error

func CfdGoGetConfidentialTxInWitness

func CfdGoGetConfidentialTxInWitness(handle uintptr, txHex string, txinIndex uint32, stackIndex uint32) (stackData string, err error)

*

  • Get witness stack on confidential transaction input.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txinIndex txin index
  • param: stackIndex witness stack index
  • return: stackData witness stack data
  • return: err error

func CfdGoGetConfidentialTxInWitnessCount

func CfdGoGetConfidentialTxInWitnessCount(handle uintptr, txHex string, txinIndex uint32) (count uint32, err error)

*

  • Get witness stack count on confidential transaction input.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txinIndex txin index
  • return: count witness stack count
  • return: err error

func CfdGoGetConfidentialTxOut

func CfdGoGetConfidentialTxOut(handle uintptr, txHex string, index uint32) (asset string, satoshiAmount int64, valueCommitment string, nonce string, lockingScript string, surjectionProof string, rangeproof string, err error)

*

  • Get txout on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index txin index
  • return: asset asset
  • return: satoshiAmount amount by satoshi
  • return: valueCommitment amount by commitment bytes.
  • return: nonce confidential nonce
  • return: lockingScript locking script
  • return: surjectionProof asset surjection proof.
  • return: rangeproof amount rangeproof.
  • return: err error

func CfdGoGetConfidentialTxOutCount

func CfdGoGetConfidentialTxOutCount(handle uintptr, txHex string) (count uint32, err error)

*

  • Get txout count on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • return: count txout count
  • return: err error

func CfdGoGetDescriptorChecksum

func CfdGoGetDescriptorChecksum(handle uintptr, networkType int, descriptor string) (descriptorAddedChecksum string, err error)

*

  • Get outputDescriptor's checksum.
  • param: handle cfd handle
  • param: networkType network type
  • param: descriptor descriptor.
  • return: descriptorAddedChecksum descriptor added checksum.
  • return: err error

func CfdGoGetIssuanceBlindingKey

func CfdGoGetIssuanceBlindingKey(handle uintptr, masterBlindingKey string, txid string, vout uint32) (blindingKey string, err error)

*

  • Get issuance blinding key.
  • param: handle cfd handle
  • param: masterBlindingKey master blinding key
  • param: txid utxo txid
  • param: vout utxo vout
  • return: blindingKey issuance blinding key
  • return: err error

func CfdGoGetLastErrorMessage

func CfdGoGetLastErrorMessage(handle uintptr) (message string, err error)

*

  • Get last error message.
  • param: handle cfd handle
  • return: message last error message
  • return: err error

func CfdGoGetParentExtkeyPathData

func CfdGoGetParentExtkeyPathData(
	handle uintptr, parentExtkey, path string, childExtkeyType int) (keyPathData, childExtkey string, err error)

*

  • Get parent key path data.
  • param: handle handle pointer.
  • param: parentExtkey parent ext key string.
  • param: path child path.
  • param: childExtkeyType child key type. (see CfdDescriptorKeyType)
  • return: keyPathData key path data.
  • return: childExtkey child ext key string.
  • return: err error

func CfdGoGetPrivkeyFromExtkey

func CfdGoGetPrivkeyFromExtkey(handle uintptr, extkey string, networkType int) (privkeyHex string, privkeyWif string, err error)

*

  • Get privkey from extprivkey.
  • param: handle cfd handle.
  • param: extkey ext privkey.
  • param: networkType network type.
  • return: privkeyHex privkey hex.
  • return: privkeyWif privkey wif.
  • return: err error

func CfdGoGetPrivkeyFromWif

func CfdGoGetPrivkeyFromWif(handle uintptr, privkeyWif string, networkType int) (privkeyHex string, err error)

*

  • Get privkey from WIF.
  • param: handle cfd handle.
  • param: privkeyWif privkey wif.
  • param: networkType privkey wif network type.
  • return: privkeyHex privkey hex.
  • return: err error

func CfdGoGetPrivkeyWif

func CfdGoGetPrivkeyWif(handle uintptr, privkeyHex string, networkType int, isCompress bool) (privkeyWif string, err error)

*

  • Get privkey WIF from hex.
  • param: handle cfd handle.
  • param: privkeyHex privkey hex.
  • param: networkType privkey wif network type.
  • param: isCompress pubkey compressed.
  • return: privkeyWif privkey wif.
  • return: err error

func CfdGoGetPubkeyFromExtkey

func CfdGoGetPubkeyFromExtkey(handle uintptr, extkey string, networkType int) (pubkey string, err error)

*

  • Get pubkey from extkey.
  • param: handle cfd handle.
  • param: extkey extkey.
  • param: networkType network type.
  • return: pubkey pubkey.
  • return: err error

func CfdGoGetPubkeyFromPrivkey

func CfdGoGetPubkeyFromPrivkey(handle uintptr, privkeyHex string, privkeyWif string, isCompress bool) (pubkey string, err error)

*

  • Get pubkey from privkey.
  • param: handle cfd handle.
  • param: privkeyHex privkey hex. (or privkeyWif)
  • param: privkeyWif privkey wif. (or privkeyHex)
  • param: isCompress pubkey compressed.
  • return: pubkey pubkey hex.
  • return: err error

func CfdGoGetSupportedFunction

func CfdGoGetSupportedFunction() (funcFlag uint64, err error)

*

  • Get supported function.
  • return: funcFlag function flag.
  • return: err error struct

func CfdGoGetTxInIssuanceInfo

func CfdGoGetTxInIssuanceInfo(handle uintptr, txHex string, index uint32) (entropy string, nonce string, assetAmount int64, assetValue string, tokenAmount int64, tokenValue string, assetRangeproof string, tokenRangeproof string, err error)

*

  • Get txin issuance on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index txin index
  • return: entropy blinding asset entropy
  • return: nonce blinding nonce
  • return: assetAmount asset amount value
  • return: assetValue asset commitment value
  • return: tokenAmount token amount value
  • return: tokenValue token commitment value
  • return: assetRangeproof asset rangeproof
  • return: tokenRangeproof token rangeproof
  • return: err error

func CfdGoInitializeBlindTx

func CfdGoInitializeBlindTx(handle uintptr) (blindHandle uintptr, err error)

*

  • Get blind transaction handle.
  • param: handle cfd handle
  • return: blindHandle blindTx handle. release: CfdGoFreeBlindHandle
  • return: err error

func CfdGoInitializeConfidentialTx

func CfdGoInitializeConfidentialTx(handle uintptr, version uint32, locktime uint32) (txHex string, err error)

*

  • Get initialized confidential transaction.
  • param: handle cfd handle
  • param: version transaction version
  • param: locktime locktime
  • return: txHex transaction hex
  • return: err error

func CfdGoInitializeMultisigSign

func CfdGoInitializeMultisigSign(handle uintptr) (multisigSignHandle uintptr, err error)

*

  • Generate multisig sign handle.
  • param: handle cfd handle
  • return: multisigSignHandle multisig sign handle. release: CfdGoFreeMultisigSignHandle
  • return: err error

func CfdGoNormalizeSignature

func CfdGoNormalizeSignature(handle uintptr, signature string) (normalizedSignature string, err error)

*

  • Normalize ec signature to low-s form
  • param: handle cfd handle
  • param: signature ec signature to nomalize
  • return: normalizeSignature normalized signature
  • return: err error

func CfdGoParseConfidentialAddress

func CfdGoParseConfidentialAddress(handle uintptr, confidentialAddress string) (address string, confidentialKey string, networkType int, err error)

*

  • Get address and confidentialKey from confidentialAddress.
  • param: handle cfd handle
  • param: confidentialAddress confidential address
  • return: address address
  • return: confidentialKey confidential key
  • return: networkType network type
  • return: err error

func CfdGoParseDescriptor

func CfdGoParseDescriptor(handle uintptr, descriptor string, networkType int, bip32DerivationPath string) (descriptorDataList []CfdDescriptorData, multisigList []CfdDescriptorKeyData, err error)

*

  • Parse Output Descriptor.
  • param: handle cfd handle
  • param: descriptor output descriptor
  • param: networkType network type
  • param: bip32DerivationPath derive path
  • return: descriptorDataList descriptor data struct list
  • return: multisigList multisig key struct list
  • return: err error

func CfdGoParsePrivkeyWif

func CfdGoParsePrivkeyWif(handle uintptr, privkeyWif string) (privkeyHex string, networkType int, isCompress bool, err error)

*

  • Parse privkey WIF data.
  • param: handle cfd handle.
  • param: privkeyWif privkey wif.
  • return: privkeyHex privkey hex.
  • return: networkType privkey wif network type.
  • return: isCompress pubkey compressed.
  • return: err error

func CfdGoParseScript

func CfdGoParseScript(handle uintptr, script string) (scriptItems []string, err error)

*

  • Parse script items from script.
  • param: handle cfd handle.
  • param: script script.
  • return: scriptItems script items.
  • return: err error

func CfdGoSetElementsMultisigScriptSig

func CfdGoSetElementsMultisigScriptSig(handle uintptr, txHex string, txid string, vout uint32, scriptsig string, hashType int) (outputTxHex string, err error)

*

  • Set multisig scriptsig to locking script.
  • param: handle cfd handle.
  • param: txHex transaction hex
  • param: txid txid
  • param: vout vout
  • param: scriptsig hex encoded script.
  • param: hashType hash type (p2pkh, p2sh, etc...)
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoSetRawReissueAsset

func CfdGoSetRawReissueAsset(handle uintptr, txHex string, txid string, vout uint32, assetSatoshiAmount int64, blindingNonce string, entropy string, address string, directLockingScript string) (asset string, outputTxHex string, err error)

*

  • Set reissuance asset to confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: txid txin txid
  • param: vout txin vout
  • param: assetSatoshiAmount generate asset amount
  • param: blindingNonce blinding nonce
  • param: entropy entropy
  • param: address destination address
  • param: directLockingScript txout locking script on direct.
  • return: asset generate asset
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoUnblindIssuance

func CfdGoUnblindIssuance(handle uintptr, txHex string, index uint32, assetBlindingKey string, tokenBlindingKey string) (asset string, assetAmount int64, assetBlindFactor string, assetValueBlindFactor string, token string, tokenAmount int64, tokenBlindFactor string, tokenValueBlindFactor string, err error)

*

  • Unblind txin issuance on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index txin index
  • param: assetBlindingKey asset blinding key
  • param: tokenBlindingKey token blinding key
  • return: asset asset
  • return: assetAmount asset amount
  • return: assetBlindFactor issueAsset asset blind factor
  • return: assetValueBlindFactor issueAsset value blind factor
  • return: token token
  • return: tokenAmount token amount
  • return: tokenBlindFactor issueToken asset blind factor
  • return: tokenValueBlindFactor issueToken value blind factor
  • return: err error

func CfdGoUnblindTxOut

func CfdGoUnblindTxOut(handle uintptr, txHex string, index uint32, blindingKey string) (asset string, satoshiAmount int64, assetBlindFactor string, valueBlindFactor string, err error)

*

  • Unblind txout on confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index txout index
  • param: blindingKey blinding key
  • return: asset asset
  • return: satoshiAmount satoshi amount
  • return: assetBlindFactor asset blind factor
  • return: valueBlindFactor amount blind factor
  • return: err error

func CfdGoUpdateConfidentialTxOut

func CfdGoUpdateConfidentialTxOut(handle uintptr, txHex string, index uint32, asset string, satoshiAmount int64, valueCommitment string, address string, directLockingScript string, nonce string) (outputTxHex string, err error)

*

  • Update txout of confidential transaction.
  • param: handle cfd handle
  • param: txHex transaction hex
  • param: index txout index
  • param: asset asset
  • param: satoshiAmount amount by satoshi
  • param: valueCommitment amount by commitment bytes.
  • param: address destination address
  • param: directLockingScript lockingScript for direct insert.
  • param: nonce confidential nonce
  • return: outputTxHex output transaction hex
  • return: err error

func CfdGoVerifyConfidentialTxSignature

func CfdGoVerifyConfidentialTxSignature(
	handle uintptr, txHex, signature, pubkey, script, txid string, vout uint32,
	sighashType int, sighashAnyoneCanPay bool, satoshiAmount int64,
	valueCommitment string, witnessVersion int) (result bool, err error)

*

  • Verify signature in transaction input.
  • param: handle cfd handle.
  • param: txHex transaction hex.
  • param: signature signature for input.
  • param: pubkey pubkey hex.
  • param: script script hex.
  • param: txid input txid.
  • param: vout input vout.
  • param: sighashType sighash type.
  • param: sighashAnyoneCanPay sighash anyone can pay flag.
  • param: satoshiAmount input satoshi amount.
  • (used only for witness input.)
  • param: valueCommitment input value commitment.
  • (used only for witness input.)
  • param: witnessVersion witness version.
  • (used only for witness input. If not witness input used, set KCfdWitnessVersionNone or "-1".)
  • return: result result of verification signature
  • return: err error

func CfdGoVerifyConfidentialTxSignatureByIndex

func CfdGoVerifyConfidentialTxSignatureByIndex(
	handle uintptr, txHex, signature, pubkey, script string, index uint32,
	sighashType int, sighashAnyoneCanPay bool, satoshiAmount int64,
	valueCommitment string, witnessVersion int) (result bool, err error)

*

  • Verify signature in transaction input by index.
  • (prototype interface)
  • param: handle cfd handle.
  • param: txHex transaction hex.
  • param: signature signature for input.
  • param: pubkey pubkey hex.
  • param: script script hex.
  • param: index index of input for verification.
  • param: sighashType sighash type.
  • param: sighashAnyoneCanPay sighash anyone can pay flag.
  • param: satoshiAmount input satoshi amount.
  • (used only for witness input.)
  • param: valueCommitment input value commitment.
  • (used only for witness input.)
  • param: witnessVersion witness version.
  • (used only for witness input. If not used, set KCfdWitnessVersionNone or "-1".)
  • return: result result of verification signature
  • return: err error

func CfdInitialize

func CfdInitialize() (_swig_ret int)

func CfdInitializeBlindTx

func CfdInitializeBlindTx(arg1 uintptr, arg2 *uintptr) (_swig_ret int)

func CfdInitializeCoinSelection

func CfdInitializeCoinSelection(arg1 uintptr, arg2 Uint32_t, arg3 Uint32_t, arg4 string, arg5 Int64_t, arg6 float64, arg7 float64, arg8 float64, arg9 Int64_t, arg10 *uintptr) (_swig_ret int)

func CfdInitializeConfidentialTx

func CfdInitializeConfidentialTx(arg1 uintptr, arg2 Uint32_t, arg3 Uint32_t, arg4 *string) (_swig_ret int)

func CfdInitializeEstimateFee

func CfdInitializeEstimateFee(arg1 uintptr, arg2 *uintptr, arg3 bool) (_swig_ret int)

func CfdInitializeMultisigScript

func CfdInitializeMultisigScript(arg1 uintptr, arg2 int, arg3 int, arg4 *uintptr) (_swig_ret int)

func CfdInitializeMultisigScriptSig

func CfdInitializeMultisigScriptSig(arg1 uintptr, arg2 *uintptr) (_swig_ret int)

func CfdInitializeMultisigSign

func CfdInitializeMultisigSign(arg1 uintptr, arg2 *uintptr) (_swig_ret int)

func CfdNormalizeSignature

func CfdNormalizeSignature(arg1 uintptr, arg2 string, arg3 *string) (_swig_ret int)

func CfdParseConfidentialAddress

func CfdParseConfidentialAddress(arg1 uintptr, arg2 string, arg3 *string, arg4 *string, arg5 *int) (_swig_ret int)

func CfdParseDescriptor

func CfdParseDescriptor(arg1 uintptr, arg2 string, arg3 int, arg4 string, arg5 *uintptr, arg6 Uint32_t) (_swig_ret int)

func CfdParsePrivkeyWif

func CfdParsePrivkeyWif(arg1 uintptr, arg2 string, arg3 *string, arg4 *int, arg5 *bool) (_swig_ret int)

func CfdParseScript

func CfdParseScript(arg1 uintptr, arg2 string, arg3 *uintptr, arg4 Uint32_t) (_swig_ret int)

func CfdSetRawReissueAsset

func CfdSetRawReissueAsset(arg1 uintptr, arg2 string, arg3 string, arg4 Uint32_t, arg5 Int64_t, arg6 string, arg7 string, arg8 string, arg9 string, arg10 *string, arg11 *string) (_swig_ret int)

func CfdUnblindIssuance

func CfdUnblindIssuance(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 string, arg5 string, arg6 *string, arg7 Int64_t, arg8 *string, arg9 *string, arg10 *string, arg11 Int64_t, arg12 *string, arg13 *string) (_swig_ret int)

func CfdUnblindTxOut

func CfdUnblindTxOut(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 string, arg5 *string, arg6 Int64_t, arg7 *string, arg8 *string) (_swig_ret int)

func CfdUpdateConfidentialTxOut

func CfdUpdateConfidentialTxOut(arg1 uintptr, arg2 string, arg3 Uint32_t, arg4 string, arg5 Int64_t, arg6 string, arg7 string, arg8 string, arg9 string, arg10 *string) (_swig_ret int)

func CfdVerifyConfidentialTxSignature

func CfdVerifyConfidentialTxSignature(arg1 uintptr, arg2 string, arg3 string, arg4 string, arg5 string, arg6 string, arg7 Uint32_t, arg8 int, arg9 bool, arg10 Int64_t, arg11 string, arg12 int) (_swig_ret int)

func Swig_free

func Swig_free(arg1 uintptr)

func Swig_malloc

func Swig_malloc(arg1 int) (_swig_ret uintptr)

Types

type CfdAddressInfo

type CfdAddressInfo struct {
	// address
	Address string
	// network type
	NetworkType int
	// hash type
	HashType int
	// witness version (unuse: -1)
	WitnessVersion int
	// locking script
	LockingScript string
	// hash
	Hash string
}

*

  • Address information struct.

func CfdGoGetAddressInfo

func CfdGoGetAddressInfo(handle uintptr, address string) (data CfdAddressInfo, err error)

*

  • Get address information.
  • param: handle cfd handle
  • param: address address string
  • return: data address data (CfdAddressInfo)
  • return: err error

type CfdAddressType

type CfdAddressType int
var KCfdP2pkhAddress CfdAddressType = _swig_getkCfdP2pkhAddress()
var KCfdP2shAddress CfdAddressType = _swig_getkCfdP2shAddress()
var KCfdP2shP2wpkhAddress CfdAddressType = _swig_getkCfdP2shP2wpkhAddress()
var KCfdP2shP2wshAddress CfdAddressType = _swig_getkCfdP2shP2wshAddress()
var KCfdP2wpkhAddress CfdAddressType = _swig_getkCfdP2wpkhAddress()
var KCfdP2wshAddress CfdAddressType = _swig_getkCfdP2wshAddress()

type CfdCoinSelectionOption

type CfdCoinSelectionOption struct {
	// fee asset
	FeeAsset string
	// tx-fee amount
	TxFeeAmount int64
	// effective feerate
	EffectiveFeeRate float64
	// longterm feerate
	LongTermFeeRate float64
	// dust feerate
	DustFeeRate float64
	// knapsack min change value
	KnapsackMinChange int64
}

*

  • CoinSelection option data struct.

func NewCfdCoinSelectionOption

func NewCfdCoinSelectionOption() CfdCoinSelectionOption

*

  • Create CfdCoinSelectionOption struct set default value.
  • return: option CoinSelection option

type CfdDescriptorData

type CfdDescriptorData struct {
	// depth (0 - )
	Depth uint32
	// script type. (CfdDescriptorScriptType)
	ScriptType int
	// locking script.
	LockingScript string
	// address string. (for ScriptType not KCfdDescriptorScriptRaw)
	Address string
	// hash type. (CfdHashType)
	HashType int
	// redeem script. (for ScriptType KCfdDescriptorScriptSh or KCfdDescriptorScriptWsh)
	RedeemScript string
	// key type. (see CfdDescriptorKeyData.KeyType)
	KeyType int
	// pubkey
	Pubkey string
	// extend pubkey
	ExtPubkey string
	// extend privkey
	ExtPrivkey string
	// has multisig
	IsMultisig bool
	// number of multisig require signatures
	ReqSigNum uint32
}

*

  • Descriptor data struct.

type CfdDescriptorKeyData

type CfdDescriptorKeyData struct {
	// key type. (CfdDescriptorKeyType)
	// - KCfdDescriptorKeyNull
	// - KCfdDescriptorKeyPublic
	// - KCfdDescriptorKeyBip32
	// - KCfdDescriptorKeyBip32Priv
	KeyType int
	// pubkey
	Pubkey string
	// extend pubkey
	ExtPubkey string
	// extend privkey
	ExtPrivkey string
}

*

  • Descriptor key data struct.

type CfdDescriptorKeyType

type CfdDescriptorKeyType int
var KCfdDescriptorKeyBip32 CfdDescriptorKeyType = _swig_getkCfdDescriptorKeyBip32()
var KCfdDescriptorKeyBip32Priv CfdDescriptorKeyType = _swig_getkCfdDescriptorKeyBip32Priv()
var KCfdDescriptorKeyNull CfdDescriptorKeyType = _swig_getkCfdDescriptorKeyNull()
var KCfdDescriptorKeyPublic CfdDescriptorKeyType = _swig_getkCfdDescriptorKeyPublic()

type CfdDescriptorScriptType

type CfdDescriptorScriptType int
var KCfdDescriptorScriptAddr CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptAddr()
var KCfdDescriptorScriptCombo CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptCombo()
var KCfdDescriptorScriptMulti CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptMulti()
var KCfdDescriptorScriptNull CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptNull()
var KCfdDescriptorScriptPk CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptPk()
var KCfdDescriptorScriptPkh CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptPkh()
var KCfdDescriptorScriptRaw CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptRaw()
var KCfdDescriptorScriptSh CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptSh()
var KCfdDescriptorScriptSortedMulti CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptSortedMulti()
var KCfdDescriptorScriptWpkh CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptWpkh()
var KCfdDescriptorScriptWsh CfdDescriptorScriptType = _swig_getkCfdDescriptorScriptWsh()

type CfdErrorCode

type CfdErrorCode int
var KCfdConnectionError CfdErrorCode = _swig_getkCfdConnectionError()
var KCfdDiskAccessError CfdErrorCode = _swig_getkCfdDiskAccessError()
var KCfdIllegalArgumentError CfdErrorCode = _swig_getkCfdIllegalArgumentError()
var KCfdIllegalStateError CfdErrorCode = _swig_getkCfdIllegalStateError()
var KCfdInternalError CfdErrorCode = _swig_getkCfdInternalError()
var KCfdInvalidSettingError CfdErrorCode = _swig_getkCfdInvalidSettingError()
var KCfdMemoryFullError CfdErrorCode = _swig_getkCfdMemoryFullError()
var KCfdOutOfRangeError CfdErrorCode = _swig_getkCfdOutOfRangeError()
var KCfdSignVerificationError CfdErrorCode = _swig_getkCfdSignVerificationError()
var KCfdSuccess CfdErrorCode = _swig_getkCfdSuccess()
var KCfdUnknownError CfdErrorCode = _swig_getkCfdUnknownError()

type CfdEstimateFeeInput

type CfdEstimateFeeInput struct {
	// utxo data
	Utxo CfdUtxo
	// is issuance input
	IsIssuance bool
	// is blind issuance input
	IsBlindIssuance bool
	// is peg-in input
	IsPegin bool
	// peg-in bitcoin tx size (require when IsPegin is true)
	PeginBtcTxSize uint32
	// fedpegscript hex (require when IsPegin is true)
	FedpegScript string
}

*

  • EstimateFee Input data struct.

type CfdEstimateFeeOption

type CfdEstimateFeeOption struct {
	// effective feerate
	EffectiveFeeRate float64
	// use elements chain
	UseElements bool
	// fee asset
	FeeAsset string
	// Require blinding or not
	RequireBlind bool
}

*

  • EstimateFee option data struct.

func NewCfdEstimateFeeOption

func NewCfdEstimateFeeOption() CfdEstimateFeeOption

*

  • Create CfdEstimateFeeOption struct set default value.
  • return: option EstimateFeeOption

type CfdExtKeyType

type CfdExtKeyType int
var KCfdExtPrivkey CfdExtKeyType = _swig_getkCfdExtPrivkey()
var KCfdExtPubkey CfdExtKeyType = _swig_getkCfdExtPubkey()

type CfdExtkeyData

type CfdExtkeyData struct {
	// version
	Version string
	// parent fingerprint
	Fingerprint string
	// chain code
	ChainCode string
	// depth
	Depth uint32
	// child number
	ChildNumber uint32
}

*

  • Extkey data struct.

func CfdGoGetExtkeyInformation

func CfdGoGetExtkeyInformation(
	handle uintptr, extkey string) (extkeyData CfdExtkeyData, err error)

*

  • Get extkey information.
  • param: handle handle pointer.
  • param: extkey ext key string.
  • return: extkeyData CfdExtkeyData
  • return: err error

type CfdHashType

type CfdHashType int
var KCfdP2pkh CfdHashType = _swig_getkCfdP2pkh()
var KCfdP2sh CfdHashType = _swig_getkCfdP2sh()
var KCfdP2shP2wpkh CfdHashType = _swig_getkCfdP2shP2wpkh()
var KCfdP2shP2wsh CfdHashType = _swig_getkCfdP2shP2wsh()
var KCfdP2wpkh CfdHashType = _swig_getkCfdP2wpkh()
var KCfdP2wsh CfdHashType = _swig_getkCfdP2wsh()

type CfdLibraryFunction

type CfdLibraryFunction int
var KCfdEnableBitcoin CfdLibraryFunction = _swig_getkCfdEnableBitcoin()
var KCfdEnableElements CfdLibraryFunction = _swig_getkCfdEnableElements()

type CfdMultisigSignData

type CfdMultisigSignData struct {
	// signature
	Signature string
	// use der encode
	IsDerEncode bool
	// sighash type. (CfdSighashType)
	SighashType int
	// sighash anyone can pay.
	SighashAnyoneCanPay bool
	// related pubkey.
	RelatedPubkey string
}

*

  • Multisig sign data struct.

type CfdNetworkType

type CfdNetworkType int
var KCfdNetworkCustomChain CfdNetworkType = _swig_getkCfdNetworkCustomChain()
var KCfdNetworkElementsRegtest CfdNetworkType = _swig_getkCfdNetworkElementsRegtest()
var KCfdNetworkLiquidv1 CfdNetworkType = _swig_getkCfdNetworkLiquidv1()
var KCfdNetworkMainnet CfdNetworkType = _swig_getkCfdNetworkMainnet()
var KCfdNetworkRegtest CfdNetworkType = _swig_getkCfdNetworkRegtest()
var KCfdNetworkTestnet CfdNetworkType = _swig_getkCfdNetworkTestnet()

type CfdSequenceLockTime

type CfdSequenceLockTime int
var KCfdSequenceLockTimeDisable CfdSequenceLockTime = _swig_getkCfdSequenceLockTimeDisable()
var KCfdSequenceLockTimeEnableMax CfdSequenceLockTime = _swig_getkCfdSequenceLockTimeEnableMax()

type CfdSighashType

type CfdSighashType int
var KCfdSigHashAll CfdSighashType = _swig_getkCfdSigHashAll()
var KCfdSigHashNone CfdSighashType = _swig_getkCfdSigHashNone()
var KCfdSigHashSingle CfdSighashType = _swig_getkCfdSigHashSingle()

type CfdTargetAmount

type CfdTargetAmount struct {
	// amount
	Amount int64
	// asset
	Asset string
}

*

  • Selection target amount struct.

type CfdTxData

type CfdTxData struct {
	// txid
	Txid string
	// witness txid
	Wtxid string
	// witness hash
	WitHash string
	// size
	Size uint32
	// virtual size
	Vsize uint32
	// weight
	Weight uint32
	// version
	Version uint32
	// locktime
	LockTime uint32
}

*

  • TxData data struct.

func CfdGoGetConfidentialTxData

func CfdGoGetConfidentialTxData(handle uintptr, txHex string) (data CfdTxData, err error)

*

  • Get confidential transaction data.
  • param: handle cfd handle
  • param: txHex transaction hex
  • return: data transaction data
  • return: err error

type CfdUtxo

type CfdUtxo struct {
	// utxo txid
	Txid string
	// utxo vout
	Vout uint32
	// amount
	Amount int64
	// asset
	Asset string
	// output descriptor
	Descriptor string
	// is issuance output
	IsIssuance bool
	// is blind issuance output
	IsBlindIssuance bool
	// is peg-in output
	IsPegin bool
	// peg-in bitcoin tx size (require when IsPegin is true)
	PeginBtcTxSize uint32
	// fedpegscript hex (require when IsPegin is true)
	FedpegScript string
}

*

  • UTXO struct.

type CfdWitnessVersion

type CfdWitnessVersion int
var KCfdWitnessVersion0 CfdWitnessVersion = _swig_getkCfdWitnessVersion0()
var KCfdWitnessVersion1 CfdWitnessVersion = _swig_getkCfdWitnessVersion1()
var KCfdWitnessVersion10 CfdWitnessVersion = _swig_getkCfdWitnessVersion10()
var KCfdWitnessVersion11 CfdWitnessVersion = _swig_getkCfdWitnessVersion11()
var KCfdWitnessVersion12 CfdWitnessVersion = _swig_getkCfdWitnessVersion12()
var KCfdWitnessVersion13 CfdWitnessVersion = _swig_getkCfdWitnessVersion13()
var KCfdWitnessVersion14 CfdWitnessVersion = _swig_getkCfdWitnessVersion14()
var KCfdWitnessVersion15 CfdWitnessVersion = _swig_getkCfdWitnessVersion15()
var KCfdWitnessVersion16 CfdWitnessVersion = _swig_getkCfdWitnessVersion16()
var KCfdWitnessVersion2 CfdWitnessVersion = _swig_getkCfdWitnessVersion2()
var KCfdWitnessVersion3 CfdWitnessVersion = _swig_getkCfdWitnessVersion3()
var KCfdWitnessVersion4 CfdWitnessVersion = _swig_getkCfdWitnessVersion4()
var KCfdWitnessVersion5 CfdWitnessVersion = _swig_getkCfdWitnessVersion5()
var KCfdWitnessVersion6 CfdWitnessVersion = _swig_getkCfdWitnessVersion6()
var KCfdWitnessVersion7 CfdWitnessVersion = _swig_getkCfdWitnessVersion7()
var KCfdWitnessVersion8 CfdWitnessVersion = _swig_getkCfdWitnessVersion8()
var KCfdWitnessVersion9 CfdWitnessVersion = _swig_getkCfdWitnessVersion9()
var KCfdWitnessVersionNone CfdWitnessVersion = _swig_getkCfdWitnessVersionNone()

type Int32_t

type Int32_t interface {
	Swigcptr() uintptr
}

type Int64_t

type Int64_t interface {
	Swigcptr() uintptr
}

type SwigcptrInt32_t

type SwigcptrInt32_t uintptr

func (SwigcptrInt32_t) Swigcptr

func (p SwigcptrInt32_t) Swigcptr() uintptr

type SwigcptrInt64_t

type SwigcptrInt64_t uintptr

func (SwigcptrInt64_t) Swigcptr

func (p SwigcptrInt64_t) Swigcptr() uintptr

type SwigcptrUint32_t

type SwigcptrUint32_t uintptr

func (SwigcptrUint32_t) Swigcptr

func (p SwigcptrUint32_t) Swigcptr() uintptr

type SwigcptrUint64_t

type SwigcptrUint64_t uintptr

func (SwigcptrUint64_t) Swigcptr

func (p SwigcptrUint64_t) Swigcptr() uintptr

type Uint32_t

type Uint32_t interface {
	Swigcptr() uintptr
}

type Uint64_t

type Uint64_t interface {
	Swigcptr() uintptr
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL