Documentation ¶
Index ¶
- Variables
- func CalculateFeeAmount(c context.Context, amount uint64) (uint64, string, error)
- func CalculateNumberOfTransactions(c context.Context, amount uint64) (uint64, error)
- func CreateDividend(c context.Context, sourceAddress string, asset string, dividendAsset string, ...) (string, int64, error)
- func CreateIssuance(c context.Context, sourceAddress string, asset string, assetDescription string, ...) (string, int64, error)
- func CreateNumericIssuance(c context.Context, sourceAddress string, asset string, quantity uint64, ...) (string, string, int64, error)
- func CreateSend(c context.Context, sourceAddress string, destinationAddress string, ...) (string, int64, error)
- func GenerateRandomAssetName(c context.Context) (string, int64, error)
- func Init()
- func InitWithConfigPath(configFilePath string)
- func SignRawTransaction(c context.Context, passphrase string, rawTxHexString string) (string, error)
- type ApiResult
- type Balance
- func GetBalancesByAddress(c context.Context, address string) ([]Balance, int64, error)
- func GetBalancesByAddressDB(c context.Context, address string) ([]Balance, int64, error)
- func GetBalancesByAsset(c context.Context, asset string) ([]Balance, int64, error)
- func GetBalancesByAssetDB(c context.Context, asset string) ([]Balance, int64, error)
- type Issuance
- type LastBlock
- type ResultCreateDividend_Counterparty
- type ResultCreateIssuance_Counterparty
- type ResultCreateSend_Counterparty
- type ResultError_Counterparty
- type ResultGetBalances
- type ResultGetIssuances
- type ResultGetRunningInfo
- type ResultGetSends
- type RunningInfo
Constants ¶
This section is empty.
Variables ¶
var Counterparty_DefaultDustSize uint64 = 5430
var Counterparty_DefaultTestingTxFee uint64 = 1500 // in satoshis
var Counterparty_DefaultTxFee uint64 = 10000 // in satoshis
Functions ¶
func CalculateFeeAmount ¶
Returns the total BTC that is required for the given number of transactions
func CalculateNumberOfTransactions ¶
Returns the number of transactions that can be performed with the given amount of BTC If the env value is not found in the context, calculations are defaulted to production
func CreateDividend ¶
func CreateDividend(c context.Context, sourceAddress string, asset string, dividendAsset string, quantityPerUnit uint64, pubKeyHexString string) (string, int64, error)
Generates unsigned hex encoded transaction to pay a dividend on an asset on Counterparty
func CreateIssuance ¶
func CreateNumericIssuance ¶
func CreateNumericIssuance(c context.Context, sourceAddress string, asset string, quantity uint64, divisible bool, pubKeyHexString string) (string, string, int64, error)
Automatically generates a numeric asset name and generates unsigned hex encoded transaction to issue an asset on Counterparty Returns: randomAssetName that was generated hex string encoded transaction errorCode error
func CreateSend ¶
func CreateSend(c context.Context, sourceAddress string, destinationAddress string, asset string, quantity uint64, pubKeyHexString string) (string, int64, error)
Generates a hex string serialed tx which contains the bitcoin transaction to send an asset from sourceAddress to destinationAddress Not exposed to the public
func GenerateRandomAssetName ¶
func InitWithConfigPath ¶
func InitWithConfigPath(configFilePath string)
func SignRawTransaction ¶
func SignRawTransaction(c context.Context, passphrase string, rawTxHexString string) (string, error)
When given the 12 word passphrase: 1) Parses the raw TX to find the address being sent from 2) Derives the parent key and the child key for the address found in step 1) 3) Signs all the TX inputs
Assumptions 1) This is a Counterparty transaction so all inputs need to be signed with the same pubkeyhash
Types ¶
type ApiResult ¶
type ApiResult struct {
// contains filtered or unexported fields
}
Create wrapper for http response and error
type Balance ¶
type Balance struct { Quantity uint64 `json:"quantity"` Asset string `json:"asset"` Address string `json:"address"` }
func GetBalancesByAddress ¶
func GetBalancesByAddressDB ¶
func GetBalancesByAsset ¶
type Issuance ¶
type Issuance struct { TxIndex uint64 `json:"tx_index"` TxHash string `json:"tx_hash"` BlockIndex uint64 `json:"block_index"` Asset string `json:"asset"` Quantity uint64 `json:"quantity"` Divisible uint64 `json:"divisible"` Source string `json:"source"` Issuer string `json:"issuer"` Transfer uint64 `json:"transfer"` Description string `json:"description"` FeePaid uint64 `json:"fee_paid"` Locked uint64 `json:"locked"` Status string `json:"status"` }
type ResultGetBalances ¶
type ResultGetIssuances ¶
type ResultGetRunningInfo ¶
type ResultGetRunningInfo struct { Jsonrpc string `json:"jsonrpc"` Id uint32 `json:"id"` Result RunningInfo `json:"result"` }
type ResultGetSends ¶
type ResultGetSends struct { TxIndex uint64 `json:"tx_index"` TxHash string `json:"tx_hash"` BlockIndex uint64 `json:"block_index"` Source string `json:"source"` Destination string `json:"destination"` Asset string `json:"asset"` Quantity uint64 `json:"quantity"` Validity uint64 `json:"validity"` Status string `json:"status"` }
tx_index (integer): The transaction index tx_hash (string): The transaction hash block_index (integer): The block index (block number in the block chain) source (string): The source address of the send destination (string): The destination address of the send asset (string): The assets being sent quantity (integer): The quantities of the specified asset sent validity (string): Set to “valid” if a valid send. Any other setting signifies an invalid/improper send
func GetSendsByAddress ¶
func GetSendsByAddressDB ¶
type RunningInfo ¶
type RunningInfo struct { DbCaughtUp bool `json:"db_caught_up"` BitCoinBlockCount uint64 `json:"bitcoin_block_count"` CounterpartydVersion string `json:"counterpartyd_version"` LastMessageIndex uint64 `json:"last_message_index"` RunningTestnet bool `json:"running_testnet"` LastBlock LastBlock `json:"last_block"` }
func GetRunningInfo ¶
func GetRunningInfo(c context.Context) (RunningInfo, int64, error)
For internal use only - don't expose to customers