Package bitcoinunlimited.libbitcoincash

Types

AddressDerivationKey
Link copied to clipboard
class AddressDerivationKey
AssertException
Link copied to clipboard
open class AssertException(why: String) : BUException
BanData
Link copied to clipboard
class BanData(reason: BanReason)

Data related to why we banned a node

BanReason
Link copied to clipboard
enum BanReason : Enum<BanReason>

Indicate why we chose not to connect to a node

BCHblock
Link copied to clipboard
class BCHblock(chainSelector: ChainSelector) : BlockHeader
BCHinput
Link copied to clipboard
class BCHinput(chainSelector: ChainSelector) : BCHserializable

Spend a coin (aka UTXO, prevout) in a transaction

BCHoutpoint
Link copied to clipboard
data class BCHoutpoint(txid: Hash256, idx: Long) : BCHserializable
BCHoutput
Link copied to clipboard
class BCHoutput(chainSelector: ChainSelector) : BCHserializable

Output of a bitcoin transaction

BCHp2pClient
Link copied to clipboard
class BCHp2pClient(chainSelector: ChainSelector, name: String, port: Int, logName: String, coScope: CoroutineScope, cocond: CoCond<Boolean>)
BCHscript
Link copied to clipboard
class BCHscript(chainSelector: ChainSelector) : BCHserializable
BCHserializable
Link copied to clipboard
open class BCHserializable
BCHserialized
Link copied to clipboard
class BCHserialized(_format: SerializationType)
BCHspendable
Link copied to clipboard
class BCHspendable(chainSelector: ChainSelector) : BCHserializable
BCHtransaction
Link copied to clipboard
class BCHtransaction(chainSelector: ChainSelector) : BCHserializable

Bitcoin transaction

BigIntegerConverters
Link copied to clipboard
class BigIntegerConverters
Bip44Wallet
Link copied to clipboard
class Bip44Wallet(name: String, chainSelector: ChainSelector, wdb: KvpDatabase) : CommonWallet

This wallet uses a single piece of random data, deriving new private keys and addresses using the technique described in BIP-0032 with key derivation paths specified by BIP-043 and BIP-044. In essence, key derivation is: m/'/'/'//index

Bip44WalletData
Link copied to clipboard
class Bip44WalletData : BCHserializable

Helper class that saves/loads data needed by the Bip44Wallet

Bip70Exception
Link copied to clipboard
open class Bip70Exception(details: Int) : BUException
Blockchain
Link copied to clipboard
class Blockchain(chainSelector: ChainSelector, name: String, net: CnxnMgr, genesisBlockHash: Hash256, checkpointPriorBlockId: Hash256, checkpointId: Hash256, checkpointHeight: Long, checkpointWork: BigInteger, context: PlatformContext, dbPrefix: String)
BlockchainException
Link copied to clipboard
open class BlockchainException(msg: String, shortMsg: String?, severity: ErrorSeverity) : BUException
BlockHeader
Link copied to clipboard
open class BlockHeader : BCHserializable

Header of a block for bitcoin-family cryptocurrencies

BlockHeaderDao
Link copied to clipboard
interface BlockHeaderDao
BlockHeaderDatabase
Link copied to clipboard
abstract class BlockHeaderDatabase : RoomDatabase
BlockLocator
Link copied to clipboard
class BlockLocator : BCHserializable

An array of block hashes, starting at the current block, and ending at the genesis block. The creator can skip blocks, populating whatever hashes he feels is most likely to identify a specific chain, closest to the splitoff point. Typically, some kind of exponential backoff is used. For example: The next 10 hashes are the previous 10 blocks (gap 1). After these, the gap is multiplied by 2 for each hash, until the genesis block is added

BlockNotForthcoming
Link copied to clipboard
open class BlockNotForthcoming(blockHash: Guid) : BlockchainException
BUException
Link copied to clipboard
open class BUException(msg: String, shortMsg: String?, severity: ErrorSeverity) : Exception
CallAfter
Link copied to clipboard
class CallAfter(doneBits: Long, fn: () -> Unit?)
CallAfterN
Link copied to clipboard
class CallAfterN(fn: () -> Unit?, count: Long)

Call the passed function after this function has been called 'count times

ChainSelector
Link copied to clipboard
enum ChainSelector : Enum<ChainSelector>

Identify the cryptocurrency/blockchain.

cli
Link copied to clipboard
annotation class cli(display: Display, help: String, delve: Int)

indicates that a member field or function should be displayed in the command line interface @param display Provides a user "capability" level to indicate more esoteric or dangerous options @param help Provides a short description of the field @param delve Should this member be displayed recursively? If delve recursive depth, then the field will be fully shown

CnxnMgr
Link copied to clipboard
abstract class CnxnMgr
CoCond
Link copied to clipboard
class CoCond<T>(scope: CoroutineScope)

Behaves like a condition, but for co-routines

Codec
Link copied to clipboard
class Codec
CommonCnxnMgr
Link copied to clipboard
abstract class CommonCnxnMgr : CnxnMgr
CommonWallet
Link copied to clipboard
abstract class CommonWallet(name: String, chainSelector: ChainSelector) : Wallet

This class provides implementations to for functions that are common to many blockchains and wallet types

DataMissingException
Link copied to clipboard
open class DataMissingException(msg: String) : BUException
DeserializationException
Link copied to clipboard
open class DeserializationException(msg: String, shortMsg: String?) : BUException
Display
Link copied to clipboard
enum Display : Enum<Display>
DisplayStyle
Link copied to clipboard
enum DisplayStyle : Enum<DisplayStyle>
DisplayStyles
Link copied to clipboard
typealias DisplayStyles = EnumSet<DisplayStyle>
EJ
Link copied to clipboard
class EJ(json: JsonElement?)
ElectrumClient
Link copied to clipboard
class ElectrumClient(chainSelector: ChainSelector, name: String, port: Int, logName: String, autostart: Boolean) : JsonRpc

Open a JSON-RPC over TCP connection to an Electrum X server

ElectrumException
Link copied to clipboard
open class ElectrumException(msg: String) : NetException
ElectrumIncorrectReply
Link copied to clipboard
class ElectrumIncorrectReply(what: String) : ElectrumException

The reply doesn't adhere to the protocol in some manner

ElectrumIncorrectRequest
Link copied to clipboard
class ElectrumIncorrectRequest(what: String) : ElectrumException

The request was not accepted by the server

ElectrumNoNodesException
Link copied to clipboard
open class ElectrumNoNodesException : ElectrumException
ElectrumNotFound
Link copied to clipboard
class ElectrumNotFound(msg: String) : ElectrumException

A passed entity was not found (transaction, block, scripthash, etc).

ElectrumRequestTimeout
Link copied to clipboard
class ElectrumRequestTimeout : ElectrumException

Electrum server never replied

ErrorSeverity
Link copied to clipboard
enum ErrorSeverity : Enum<ErrorSeverity>
exactBytes
Link copied to clipboard
class exactBytes(data: ByteArray)

This class behaves like a function and its sole purpose is to wrap a bytearray into another class so that when we serialize it we know not to include the length

GlueWalletBlockchain
Link copied to clipboard
class GlueWalletBlockchain(chain: Blockchain) : BCHserializable

Helper class that glues a wallet to a blockchain

GroupAuthorityFlags
Link copied to clipboard
class GroupAuthorityFlags
GroupId
Link copied to clipboard
data class GroupId(data: ByteArray) : BCHserializable
GroupInfo
Link copied to clipboard
data class GroupInfo(groupId: GroupId, tokenAmt: Long, authorityFlags: ULong)
Guid
Link copied to clipboard
class Guid(data: Hash256) : BCHserializable
Hash
Link copied to clipboard
class Hash
Hash256
Link copied to clipboard
data class Hash256(hash: ByteArray) : BCHserializable
Hash256Converters
Link copied to clipboard
class Hash256Converters
HeadersNotForthcoming
Link copied to clipboard
open class HeadersNotForthcoming(blockHash: Guid) : BlockchainException
IdentityDomain
Link copied to clipboard
class IdentityDomain(domain: String, useIdentity: Long) : BCHserializable
Initialize
Link copied to clipboard
open class Initialize
Inv
Link copied to clipboard
class Inv(type: Inv.Types, id: Guid) : BCHserializable
IpPort
Link copied to clipboard
data class IpPort(ip: String, port: Int)

Helper class to pass around ip and port pairs

JsonRpc
Link copied to clipboard
open class JsonRpc(name: String, port: Int, logName: String, useSSL: Boolean)
Key
Link copied to clipboard
class Key

Sign data (compatible with OP_CHECKDATASIG)

KeyPairPtr
Link copied to clipboard
typealias KeyPairPtr = Long
KvpDao
Link copied to clipboard
interface KvpDao
KvpData
Link copied to clipboard
class KvpData
KvpDatabase
Link copied to clipboard
abstract class KvpDatabase : RoomDatabase
MerkleBlock
Link copied to clipboard
class MerkleBlock(chainSelector: ChainSelector) : BlockHeader

A block that contains a subset of the total number of transactions, and includes a merkle proof that the provided transactions are part of the block

MultiNodeCnxnMgr
Link copied to clipboard
class MultiNodeCnxnMgr(chainName: String, netType: ChainSelector, seed: Array<String>) : CommonCnxnMgr
MultisigDestination
Link copied to clipboard
class MultisigDestination(chain: ChainSelector, minSigs: Int, pubkeys: Array<ByteArray>, privkeys: Array<Secret?>) : Pay2ScriptHashDestination
NetException
Link copied to clipboard
open class NetException(msg: String) : Exception
NetMsgType
Link copied to clipboard
enum NetMsgType : Enum<NetMsgType>
NetMsgTypeCodingError
Link copied to clipboard
open class NetMsgTypeCodingError(msg: String) : P2PException
NetworkConstants
Link copied to clipboard
class NetworkConstants
NEW_WALLET
Link copied to clipboard
object NEW_WALLET : WalletStartup
NodeServices
Link copied to clipboard
class NodeServices
OP
Link copied to clipboard
class OP(v: ByteArray)
P2PDisconnectedException
Link copied to clipboard
open class P2PDisconnectedException(msg: String) : P2PException
P2PException
Link copied to clipboard
open class P2PException(msg: String) : NetException
P2PNoNodesException
Link copied to clipboard
open class P2PNoNodesException : P2PException
Pay2PubKeyHashDestination
Link copied to clipboard
class Pay2PubKeyHashDestination(chainSelector: ChainSelector, secret: Secret) : PayDestination

Represents a "standard" P2PKH payment destination

Pay2ScriptHashDestination
Link copied to clipboard
open class Pay2ScriptHashDestination(chainSelector: ChainSelector) : PayDestination

Represents an arbitrary P2SH destination

Pay2ScriptPubKeyDestination
Link copied to clipboard
class Pay2ScriptPubKeyDestination(chainSelector: ChainSelector, secret: Secret) : PayDestination

Represents a P2PK (pay to public key) destination wrapped in a P2SH script

PayAddress
Link copied to clipboard
data class PayAddress(blockchain: ChainSelector, type: PayAddressType, data: ByteArray) : BCHserializable
PayAddressBlankException
Link copied to clipboard
open class PayAddressBlankException(msg: String) : PayAddressException
PayAddressDecodeException
Link copied to clipboard
open class PayAddressDecodeException(msg: String) : PayAddressException
PayAddressException
Link copied to clipboard
open class PayAddressException(msg: String, shortMsg: String?, severity: ErrorSeverity) : BUException
PayAddressType
Link copied to clipboard
enum PayAddressType : Enum<PayAddressType>
PayDestination
Link copied to clipboard
abstract class PayDestination(chainSelector: ChainSelector) : BCHserializable

A destination for payments. This includes all the information needed to send and spend from this destination. It is often assumed that Bitcoin addresses are payment destinations, but this is not true. You really need an output script, and also (if P2SH) a redeem script. The reason why P2PKH addresses "work" as payment destinations is because they imply a specific script. But "baking in" this assumption will make the wallet a lot less flexible.

PayloadContract
Link copied to clipboard
class PayloadContract

A Bitcoin Cash contract is a designed to allow maximum arbitrary data payload in the input spending from the contract

PayloadContractDestination
Link copied to clipboard
class PayloadContractDestination(chain: ChainSelector, secret: Secret, payload: ByteArray) : PayDestination
PaymentHistory
Link copied to clipboard
class PaymentHistory : BCHserializable

Track the history of individual payments (inputs or outputs), made by this wallet

PBlockHeader
Link copied to clipboard
open class PBlockHeader : BlockHeader
Periodically
Link copied to clipboard
class Periodically(periodInMs: Long)
PlatformContext
Link copied to clipboard
class PlatformContext(context: Context)
PossibleConnection
Link copied to clipboard

This class tracks possible blockchain nodes -- we have learned about this node from some source but the data may not be accurate

ProspectivePayment
Link copied to clipboard
class ProspectivePayment
Reactive
Link copied to clipboard
class Reactive<T>(value: T)

A class that encapsulates the idea that when an object changes, other entities should be notified of the change. This is extremely useful in GUI development since onscreen object can be made to "automatically" update based on changes to the "Reactive" underlying object that is being displayed.

Reactor
Link copied to clipboard
abstract class Reactor<T>

Any object that responds to changes in a Reactive object

ReceivedMessage
Link copied to clipboard
class ReceivedMessage(cmd: ByteArray, dat: ByteArray)
RegTestCnxnMgr
Link copied to clipboard
open class RegTestCnxnMgr(chainName: String, nodeIp: String, nodePort: Int) : CommonCnxnMgr
RequestedPrehistoryHeader
Link copied to clipboard
open class RequestedPrehistoryHeader(blockHash: Guid) : HeadersNotForthcoming
RequestMgr
Link copied to clipboard
class RequestMgr(net: CnxnMgr, genesisBlockHash: Hash256)
RewindData
Link copied to clipboard
class RewindData(chainSelector: ChainSelector) : BCHserializable

If a block is rewound, this is how to undo it. Also constitutes all the data needed to show transaction history.

RingSignature
Link copied to clipboard
class RingSignature
Secret
Link copied to clipboard
abstract class Secret
SerializationType
Link copied to clipboard
enum SerializationType : Enum<SerializationType>
TagPtr
Link copied to clipboard
typealias TagPtr = Long
TextViewReactor
Link copied to clipboard
class TextViewReactor<T>(gui: TextView) : Reactor<T>
ThreadCond
Link copied to clipboard
class ThreadCond : Object
TraceResult
Link copied to clipboard
enum TraceResult : Enum<TraceResult>
TransactionException
Link copied to clipboard
open class TransactionException(msg: String) : BUException
TransactionHistory
Link copied to clipboard
class TransactionHistory(chainSelector: ChainSelector, tx: BCHtransaction) : BCHserializable
TxCompletionFlags
Link copied to clipboard
class TxCompletionFlags

Let's be blunt: Kotlin enums are unusable

UnimplementedException
Link copied to clipboard
open class UnimplementedException(msg: String, shortMsg: String?) : BUException
Units
Link copied to clipboard
enum Units : Enum<Units>
UnknownBlockchainException
Link copied to clipboard
open class UnknownBlockchainException : BUException
UnsecuredSecret
Link copied to clipboard
class UnsecuredSecret(secretBytes: ByteArray) : Secret
UtilStringEncoding
Link copied to clipboard
class UtilStringEncoding
UtilVote
Link copied to clipboard
class UtilVote
variableSized
Link copied to clipboard
class variableSized(data: ByteArray)

This class behaves like a function and its sole purpose is to wrap a bytearray into another class so that when we serialize it we know to include the length

Wallet
Link copied to clipboard
abstract class Wallet

This class defines a wallet interface. A wallet is a set of payment destinations that are being tracked on a particular blockchain.

WalletDisconnectedException
Link copied to clipboard
open class WalletDisconnectedException : WalletException
WalletDustException
Link copied to clipboard
open class WalletDustException(msg: String) : BUException
WalletException
Link copied to clipboard
open class WalletException(msg: String, shortMsg: String?, severity: ErrorSeverity) : BUException
WalletFeeException
Link copied to clipboard
open class WalletFeeException(msg: String, severity: ErrorSeverity) : BUException
WalletImplementationException
Link copied to clipboard
open class WalletImplementationException(msg: String) : BUException
WalletIncompatibleAddress
Link copied to clipboard
open class WalletIncompatibleAddress(msg: String) : BUException
WalletKeyDataMissingException
Link copied to clipboard
open class WalletKeyDataMissingException : WalletException
WalletNotEnoughBalanceException
Link copied to clipboard
open class WalletNotEnoughBalanceException(msg: String) : BUException
WalletNotEnoughTokenBalanceException
Link copied to clipboard
open class WalletNotEnoughTokenBalanceException(msg: String) : BUException
WalletNotSupportedException
Link copied to clipboard
open class WalletNotSupportedException(msg: String) : WalletException
WalletStartup
Link copied to clipboard
sealed class WalletStartup

Functions

afterTextChanged
Link copied to clipboard
fun EditText.afterTextChanged(afterTextChanged: (String) -> Unit)
Bip39InvalidWords
Link copied to clipboard
fun Bip39InvalidWords(words: List<String>): List<String>
Bip44AddressDerivationByChain
Link copied to clipboard
fun Bip44AddressDerivationByChain(chainSelector: ChainSelector): Long

Return the Bip44 address number based on this blockchain

ChainSelectorFromAddress
Link copied to clipboard
fun ChainSelectorFromAddress(address: String): ChainSelector
ChainSelectorFromValue
Link copied to clipboard
fun ChainSelectorFromValue(v: Byte): ChainSelector
chainStateDbKey
Link copied to clipboard
fun chainStateDbKey(name: String, chainSelector: ChainSelector): String
clearAllTables
Link copied to clipboard
fun clearAllTables(db: RoomDatabase)
cliDump
Link copied to clipboard
fun cliDump(obj: Any?, level: Display = Display.User, style: DisplayStyles = DEFAULT_STYLE, depth: Int = 2, indent: Int = 0): String
completeJsonPay
Link copied to clipboard
fun completeJsonPay(pip: ProspectivePayment, tx: BCHtransaction)
copyInto
Link copied to clipboard
fun ByteArray.copyInto(to: ByteArray, location: Int = 0): ByteArray
CurrencyDecimal
Link copied to clipboard
fun CurrencyDecimal(a: Long): BigDecimal
fun CurrencyDecimal(a: String): BigDecimal

Create a BigDecimal that is appropriate for currency mathematics (with lots of decimal places)

dbgAssertGuiThread
Link copied to clipboard
fun dbgAssertGuiThread()
dbgAssertNotGuiThread
Link copied to clipboard
fun dbgAssertNotGuiThread()
DbgRender
Link copied to clipboard
fun DbgRender(obj: Hash256): String
deleteBlockHeaders
Link copied to clipboard
fun deleteBlockHeaders(name: String, dbPrefix: String, context: PlatformContext)

Delete all block headers in the database -- used in regression testing

deleteWallet
Link copied to clipboard
fun deleteWallet(db: KvpDatabase, walletName: String, chainSelector: ChainSelector)
fun deleteWallet(ctxt: PlatformContext, walletName: String, chainSelector: ChainSelector)

Delete a wallet on disk

deNullable
Link copied to clipboard
fun <T : BCHserializable> BCHserialized.deNullable(Tfactory: (BCHserialized) -> T): T?

Deserialize any object that is nullable, but prepending a byte indicating whether this object is null or not. This API should only be used for DISK serialization because this nullable technique is not part of the network protocol

denullHash
Link copied to clipboard
fun BCHserialized.denullHash(): Hash256?
Dust
Link copied to clipboard
fun Dust(chain: ChainSelector): Long
epochToDate
Link copied to clipboard
fun epochToDate(epochSeconds: Long): String
free_keypair
Link copied to clipboard
external fun free_keypair(keyPair: KeyPairPtr)
free_tag
Link copied to clipboard
external fun free_tag(tag: TagPtr)
FromHex
Link copied to clipboard
fun String.fromHex(): ByteArray
generate_keypair
Link copied to clipboard
external fun generate_keypair(): KeyPairPtr
generate_keypair_from_bits
Link copied to clipboard
external fun generate_keypair_from_bits(bits: ByteArray): KeyPairPtr
GenerateBip39SecretWords
Link copied to clipboard
fun GenerateBip39SecretWords(bytes: ByteArray, wordList: Array<String> = englishWordList): String
GenerateBip39Seed
Link copied to clipboard
fun GenerateBip39Seed(wordseed: String, passphrase: String, size: Int = 64): ByteArray
GenerateEntropy
Link copied to clipboard
fun GenerateEntropy(ent: Int): ByteArray
get_privkey
Link copied to clipboard
external fun get_privkey(keyPair: KeyPairPtr): ByteArray
get_pubkey
Link copied to clipboard
external fun get_pubkey(keyPair: KeyPairPtr): ByteArray
getApis
Link copied to clipboard
fun getApis(obj: Any, level: Display = Display.User, style: DisplayStyles = EnumSet.of(DisplayStyle.OneLine)): String?
getCachedTip
Link copied to clipboard
fun BlockHeaderDao.getCachedTip(): PBlockHeader?
getClassApis
Link copied to clipboard
fun getClassApis(cls: KClass<*>, level: Display = Display.User, style: DisplayStyles = EnumSet.of(DisplayStyle.OneLine)): String?
GetLog
Link copied to clipboard
fun GetLog(module: String): Logger
getObjectType
Link copied to clipboard
fun getObjectType(obj: Any, style: DisplayStyles = DEFAULT_STYLE): String
GetWalletData
Link copied to clipboard
fun GetWalletData(name: String, db: KvpDatabase): Bip44WalletData
groupedFilter
Link copied to clipboard
fun groupedFilter(groupId: GroupId, normal: Boolean = true, authority: ULong = GroupAuthorityFlags.AUTHORITY): (BCHspendable) -> Boolean
handleThreadException
Link copied to clipboard
fun handleThreadException(e: Exception, s: String = "")
identityDomainsDbKey
Link copied to clipboard
fun identityDomainsDbKey(name: String): String
iHaveInternet
Link copied to clipboard
fun iHaveInternet(): Boolean
init_tag
Link copied to clipboard
external fun init_tag(issue: ByteArray): TagPtr
invert
Link copied to clipboard
fun <K, V> Map<K, V>.invert(): Map<V, K>

Create a new map, where the keys and values are swapped

isPrimitive
Link copied to clipboard
fun isPrimitive(obj: Any?): Boolean
join
Link copied to clipboard
fun MutableList<ByteArray>.join(): ByteArray
jsonify
Link copied to clipboard
fun List<Any>.jsonify(): String
laterUI
Link copied to clipboard
fun laterUI(fn: suspend () -> Unit)

Do whatever you pass within the user interface context, asynchronously

launch
Link copied to clipboard
fun launch(scope: CoroutineScope? = null, fn: suspend () -> Unit?)
LoadPayAddressType
Link copied to clipboard
fun LoadPayAddressType(v: Byte): PayAddressType
max
Link copied to clipboard
fun max(a: Long, b: Long): Long
min
Link copied to clipboard
fun min(a: Long, b: Long): Long
notInUI
Link copied to clipboard
fun notInUI(fn: () -> Unit)

execute the passed code block directly if not in the UI thread, otherwise defer it

OpenBlockHeaderDB
Link copied to clipboard
fun OpenBlockHeaderDB(context: PlatformContext, name: String): BlockHeaderDatabase?
OpenKvpDB
Link copied to clipboard
fun OpenKvpDB(context: PlatformContext, name: String): KvpDatabase?
paymentHistoryDbKey
Link copied to clipboard
fun paymentHistoryDbKey(name: String): String
PersistInsert
Link copied to clipboard
fun PersistInsert(dbdao: BlockHeaderDao, bh: BlockHeader)
post
Link copied to clipboard
fun HttpURLConnection.post(data: ByteArray, headers: Map<String, String>, timeout: Int = 10000)
fun HttpURLConnection.post(data: String, headers: Map<String, String>, timeout: Int = 10000)
processJsonPay
Link copied to clipboard
fun processJsonPay(bip72: String): ProspectivePayment
queryMap
Link copied to clipboard
fun URL.queryMap(): Map<String, String>
range
Link copied to clipboard
fun range(start: Int, count: Int): IntRange
receive
Link copied to clipboard
suspend fun <T> Channel<T>.receive(timeout: Long): T?

Receive from a channel with timeout

rem
Link copied to clipboard
operator fun String.rem(kv: Map<String, String>): String

template replacement using a string like "%a foo %b" % mapOf("a" to "first", "b" to "second") returns "first foo second"

RunningTheTests
Link copied to clipboard
fun RunningTheTests(): Boolean
scriptDataFrom
Link copied to clipboard
fun scriptDataFrom(scriptBytes: ByteArray): ByteArray?
scriptNumFrom
Link copied to clipboard
fun scriptNumFrom(scriptBytes: ByteArray): Long
SecRandom
Link copied to clipboard
fun SecRandom(data: ByteArray): ByteArray

Provide random bytes to the C layer (needed on Android platforms where C does not have access to a cryptographically secure random number generator)

setCachedTip
Link copied to clipboard
fun BlockHeaderDao.setCachedTip(header: BlockHeader)
SetupBooleanPreferenceGui
Link copied to clipboard
fun SetupBooleanPreferenceGui(key: String, db: SharedPreferences, button: CompoundButton, onChecked: (CompoundButton?, Boolean) -> Unit? = null): Boolean

Connects a gui switch to a preference DB item. To be called in onCreate. Returns the current state of the preference item. Uses setOnCheckedChangeListener, so you cannot call that yourself. Instead pass your listener into this function

SetupTextPreferenceGui
Link copied to clipboard
fun SetupTextPreferenceGui(key: String, db: SharedPreferences, view: EditText)

Connects a gui text entry field to a preference DB item. To be called in onCreate

shouldDisplay
Link copied to clipboard
fun shouldDisplay(obj: KAnnotatedElement, level: Display): Boolean
show
Link copied to clipboard
fun show(p: KProperty1<*, *>, obj: Any): String
fun <K, V> MutableMap<K, V>.show(level: Display = Display.User, style: DisplayStyles = DEFAULT_STYLE, indent: Int = 0): String?
showHelp
Link copied to clipboard
fun showHelp(s: String, style: DisplayStyles, indent: Int): String

Shows or doesn't show the help and formats it depending on the display style

showObject
Link copied to clipboard
fun showObject(obj: Any, level: Display = Display.User, style: DisplayStyles = DEFAULT_STYLE, depth: Int = 0, indent: Int = 0): String
showProperties
Link copied to clipboard
fun showProperties(obj: Any, cls: KClass<*>, level: Display, style: DisplayStyles, depth: Int = 0, indent: Int = 0): String
showType
Link copied to clipboard
fun showType(typeName: String?, style: DisplayStyles = DEFAULT_STYLE): String
sign_message
Link copied to clipboard
external fun sign_message(msg: ByteArray, tag: TagPtr, privkey: ByteArray): ByteArray
signInput
Link copied to clipboard
fun signInput(tx: BCHtransaction, idx: Long, sigHashType: Int, serializedTx: ByteArray? = null): Boolean
signTransaction
Link copied to clipboard
fun signTransaction(tx: BCHtransaction, sigHashType: Int = 0x41)
sourceLoc
Link copied to clipboard
fun sourceLoc(): String
SplitIpPort
Link copied to clipboard
fun SplitIpPort(s: String, defaultPort: Int): Pair<String, Int>

split a (IP or FQDN):port formatted string (e.g 192.168.100.10:54 or www.example.com:54) into a string IP address (or FQDN) and an integer port

syncNotInUI
Link copied to clipboard
fun <RET> syncNotInUI(fn: () -> RET): RET
tag_add_pubkey
Link copied to clipboard
external fun tag_add_pubkey(tag: TagPtr, pubkey: ByteArray)
ToHex
Link copied to clipboard
fun ByteArray.toHex(): String
ToHexStr
Link copied to clipboard
fun ToHexStr(ba: ByteArray): String
toPositiveInt
Link copied to clipboard
fun Byte.toPositiveInt(): Int
toPositiveLong
Link copied to clipboard
fun Byte.toPositiveLong(): Long
toString
Link copied to clipboard
fun <T : Long> T.toString(u: Units): String
toStringU
Link copied to clipboard
fun <T : Int> T.toStringU(u: Units): String
toUint
Link copied to clipboard
fun Byte.toUint(): Int
toUrl
Link copied to clipboard
fun String.toUrl(): URL

Convert a uri scheme to a url, and then plug it into the java URL parser.

trace_signature
Link copied to clipboard
external fun trace_signature(message1: ByteArray, signature1: ByteArray, message2: ByteArray, signature2: ByteArray, tag: TagPtr): Array<Any>
txHistoryDbKey
Link copied to clipboard
fun txHistoryDbKey(name: String): String
txStateDbKey
Link copied to clipboard
fun txStateDbKey(name: String): String
unusedAddressesDbKey
Link copied to clipboard
fun unusedAddressesDbKey(name: String): String
upsert
Link copied to clipboard
fun KvpDao.upsert(d: KvpData): Boolean
validate
Link copied to clipboard
fun EditText.validate(validator: (String) -> Boolean, message: String)
verify_message
Link copied to clipboard
external fun verify_message(msg: ByteArray, tag: TagPtr, signature: ByteArray): Boolean
withPeersFrom
Link copied to clipboard
fun withPeersFrom(seedername: String, callback: (Set<InetAddress>) -> Unit)

Properties

appContext
Link copied to clipboard
var appContext: PlatformContext? = null
appI18n
Link copied to clipboard
var appI18n: (Int) -> String
APPROX_P2PKH_SIG_SCRIPT_LEN
Link copied to clipboard
const val APPROX_P2PKH_SIG_SCRIPT_LEN: Int
BCH_CASH_MAGIC_MAINNET
Link copied to clipboard
val BCH_CASH_MAGIC_MAINNET: ByteArray
BCH_CASH_MAGIC_REGTEST
Link copied to clipboard
val BCH_CASH_MAGIC_REGTEST: ByteArray
BCH_CASH_MAGIC_TESTNET3
Link copied to clipboard
val BCH_CASH_MAGIC_TESTNET3: ByteArray
bchDecimals
Link copied to clipboard
val bchDecimals: Int = 8
bchFormat
Link copied to clipboard
val bchFormat: DecimalFormat
BCHidentityParams
Link copied to clipboard
val BCHidentityParams: Array<String>
BCHmainnetPort
Link copied to clipboard
val BCHmainnetPort: Int = 8333
BCHnolnetPort
Link copied to clipboard
val BCHnolnetPort: Int = 9333
BCHregtest2Port
Link copied to clipboard
val BCHregtest2Port: Int = 8334
BCHregtestPort
Link copied to clipboard
val BCHregtestPort: Int = 18444
BCHtestnetPort
Link copied to clipboard
val BCHtestnetPort: Int = 18333
BLOCK_REQ_TIMEOUT
Link copied to clipboard
val BLOCK_REQ_TIMEOUT: Long
BlockchainNetMagic
Link copied to clipboard
val BlockchainNetMagic: Map<ChainSelector, ByteArray>
BlockchainPort
Link copied to clipboard
val BlockchainPort: Map<ChainSelector, Int>
chainToCurrencyCode
Link copied to clipboard
val chainToCurrencyCode: Map<ChainSelector, String>

Convert a ChainSelector to its uri and address prefix

chainToMilliCurrencyCode
Link copied to clipboard
val chainToMilliCurrencyCode: Map<ChainSelector, String>

Convert a ChainSelector to its milli-currency code

chainToURI
Link copied to clipboard
val chainToURI: Map<ChainSelector, String>

Convert a ChainSelector to its uri and address prefix

CHOP_SIZE
Link copied to clipboard
val CHOP_SIZE: Int = 8192
CLIENT_SUBVERSION
Link copied to clipboard
val CLIENT_SUBVERSION: String
currencyCodeToChain
Link copied to clipboard
val currencyCodeToChain: Map<String, ChainSelector>

Convert a uri or address prefix to a ChainSelector -- throws exception if not found

currencyMath
Link copied to clipboard
val currencyMath: MathContext
currencyScale
Link copied to clipboard
val currencyScale: Int = 16
DEBUG
Link copied to clipboard
val DEBUG: Boolean = false
DEFAULT_SSL_ELECTRUM_PORT
Link copied to clipboard
const val DEFAULT_SSL_ELECTRUM_PORT: Int = 50002
DEFAULT_STYLE
Link copied to clipboard
val DEFAULT_STYLE: EnumSet<DisplayStyle>
DEFAULT_TCP_ELECTRUM_PORT
Link copied to clipboard
const val DEFAULT_TCP_ELECTRUM_PORT: Int = 50001
DEFAULT_TCP_ELECTRUM_PORT_REGTEST
Link copied to clipboard
const val DEFAULT_TCP_ELECTRUM_PORT_REGTEST: Int = 60401
DesiredFeeSatPerByte
Link copied to clipboard
const val DesiredFeeSatPerByte: Double = 1.1
ELECTRUM_INVALID_PARAMS
Link copied to clipboard
const val ELECTRUM_INVALID_PARAMS: Int
ELECTRUM_REQ_TIMEOUT
Link copied to clipboard
val ELECTRUM_REQ_TIMEOUT: Int = 5000
englishWordList
Link copied to clipboard
val englishWordList: Array<String>
fiatFormat
Link copied to clipboard
val fiatFormat: DecimalFormat
GEN_ADDRESS_CHUNK_SIZE
Link copied to clipboard
const val GEN_ADDRESS_CHUNK_SIZE: Int = 100
HEADER_SIZE_BYTES
Link copied to clipboard
const val HEADER_SIZE_BYTES: Int = 80
hexRep
Link copied to clipboard
val hexRep: String
INCLUDE_NEXTCHAIN
Link copied to clipboard
val INCLUDE_NEXTCHAIN: Boolean = true
launchExceptionHandler
Link copied to clipboard
var launchExceptionHandler: (e: Exception) -> Boolean? = null

callback to notify app of any exception that happened within the coroutine launch. Return False to raise the exception, causing program abort. If null, exception is logged and ignored

MAX_QUIET_TIME_SEC
Link copied to clipboard
val MAX_QUIET_TIME_SEC: Int = 60
MAX_SHOW_COLLECTION_SIZE
Link copied to clipboard
val MAX_SHOW_COLLECTION_SIZE: Int = 5
MaxFee
Link copied to clipboard
var MaxFee: Int = 20000
MaxFeePerByte
Link copied to clipboard
const val MaxFeePerByte: Double = 5.0
mBchDecimals
Link copied to clipboard
val mBchDecimals: Int = 5
mBchFormat
Link copied to clipboard
val mBchFormat: DecimalFormat
MinFeeSatPerByte
Link copied to clipboard
const val MinFeeSatPerByte: Double = 1.01
mRBCHPort
Link copied to clipboard
val mRBCHPort: Int = 7227
MY_CNXNS_ONLY
Link copied to clipboard
val MY_CNXNS_ONLY: Boolean = false
NEXTCHAIN_CASH_MAGIC_MAINNET
Link copied to clipboard
val NEXTCHAIN_CASH_MAGIC_MAINNET: ByteArray
NextChainPort
Link copied to clipboard
val NextChainPort: Int = 7228
PING_QUIET_TIME_SEC
Link copied to clipboard
val PING_QUIET_TIME_SEC: Int = 35
PREHISTORY_SAFEFTY_FACTOR
Link copied to clipboard
const val PREHISTORY_SAFEFTY_FACTOR: Int
PROTOCOL_VERSION
Link copied to clipboard
val PROTOCOL_VERSION: Int = 80003
RbadAddress
Link copied to clipboard
val RbadAddress: Int
RbadTransaction
Link copied to clipboard
val RbadTransaction: Int
RbadWalletImplementation
Link copied to clipboard
val RbadWalletImplementation: Int
Rbip70NoAmount
Link copied to clipboard
val Rbip70NoAmount: Int
RblankAddress
Link copied to clipboard
val RblankAddress: Int
RblockNotForthcoming
Link copied to clipboard
val RblockNotForthcoming: Int
RdataMissing
Link copied to clipboard
val RdataMissing: Int
RdeductedFeeLargerThanSendAmount
Link copied to clipboard
val RdeductedFeeLargerThanSendAmount: Int
ReactionCtxt
Link copied to clipboard
val ReactionCtxt: CoroutineContext

The default context to execute reactions in

ReactionScope
Link copied to clipboard
val ReactionScope: CoroutineScope
REG_TEST_ONLY
Link copied to clipboard
val REG_TEST_ONLY: Boolean = false
RexcessiveFee
Link copied to clipboard
val RexcessiveFee: Int
Rexpired
Link copied to clipboard
val Rexpired: Int
RfeeExceedsFlatMax
Link copied to clipboard
val RfeeExceedsFlatMax: Int
RheadersNotForthcoming
Link copied to clipboard
val RheadersNotForthcoming: Int
RinsufficentBalance
Link copied to clipboard
val RinsufficentBalance: Int
RnoNodes
Link copied to clipboard
val RnoNodes: Int
RnotSupported
Link copied to clipboard
val RnotSupported: Int
RsendDust
Link copied to clipboard
val RsendDust: Int
RsendMoreThanBalance
Link copied to clipboard
val RsendMoreThanBalance: Int
RwalletAndAddressIncompatible
Link copied to clipboard
val RwalletAndAddressIncompatible: Int
RwalletDisconnectedFromBlockchain
Link copied to clipboard
var RwalletDisconnectedFromBlockchain: Int
SATinMBCH
Link copied to clipboard
val SATinMBCH: Long
serializeFormat
Link copied to clipboard
val serializeFormat: DecimalFormat
TX_SCRIPTLESS_INPUT_SIZE
Link copied to clipboard
const val TX_SCRIPTLESS_INPUT_SIZE: Int
uriToChain
Link copied to clipboard
val uriToChain: Map<String, ChainSelector>

Convert a uri or address prefix to a ChainSelector -- throws exception if not found