legacyrpc

package
v0.0.0-...-51a2c09 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: ISC Imports: 39 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MininumAmount = 1000000
)

Variables

View Source
var (
	ErrNeedPositiveAmount = InvalidParameterError{
		errors.New("amount must be positive"),
	}

	ErrNeedBelowMaxAmount = InvalidParameterError{
		errors.New("amount must be below max amount"),
	}

	ErrNeedPositiveSpendLimit = InvalidParameterError{
		errors.New("spend limit must be positive"),
	}

	ErrNeedPositiveMinconf = InvalidParameterError{
		errors.New("minconf must be positive"),
	}

	ErrAddressNotInWallet = hcjson.RPCError{
		Code:    hcjson.ErrRPCWallet,
		Message: "address not found in wallet",
	}

	ErrAccountNameNotFound = hcjson.RPCError{
		Code:    hcjson.ErrRPCWalletInvalidAccountName,
		Message: "account name not found",
	}

	ErrUnloadedWallet = hcjson.RPCError{
		Code:    hcjson.ErrRPCWallet,
		Message: "Request requires a wallet but wallet has not loaded yet",
	}

	ErrWalletUnlockNeeded = hcjson.RPCError{
		Code:    hcjson.ErrRPCWalletUnlockNeeded,
		Message: "Enter the wallet passphrase with walletpassphrase first",
	}

	ErrNotImportedAccount = hcjson.RPCError{
		Code:    hcjson.ErrRPCWallet,
		Message: "imported addresses must belong to the imported account",
	}

	ErrNoTransactionInfo = hcjson.RPCError{
		Code:    hcjson.ErrRPCNoTxInfo,
		Message: "No information for transaction",
	}

	ErrReservedAccountName = hcjson.RPCError{
		Code:    hcjson.ErrRPCInvalidParameter,
		Message: "Account name is reserved by RPC server",
	}

	ErrMainNetSafety = hcjson.RPCError{
		Code:    hcjson.ErrRPCWallet,
		Message: "RPC function disabled on MainNet wallets for security purposes",
	}
)

Errors variables that are defined once here to avoid duplication below.

View Source
var ErrNoAuth = errors.New("no auth")

ErrNoAuth represents an error where authentication could not succeed due to a missing Authorization HTTP header.

Functions

func OmniCreateAgreement

func OmniCreateAgreement(icmd interface{}, w *wallet.Wallet) (interface{}, error)

func OmniCreatepayloadCancelalltrades

func OmniCreatepayloadCancelalltrades(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadCancelalltrades Creates the payload to cancel all offers on the distributed token exchange with the given currency pair. $ omnicore-cli "omni_createpayload_cancelalltrades" 1

func OmniCreatepayloadCanceltradesbypair

func OmniCreatepayloadCanceltradesbypair(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadCanceltradesbypair Creates the payload to cancel all offers on the distributed token exchange with the given currency pair. $ omnicore-cli "omni_createpayload_canceltradesbypair" 1 31

func OmniCreatepayloadCanceltradesbyprice

func OmniCreatepayloadCanceltradesbyprice(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadCanceltradesbyprice Creates the payload to cancel offers on the distributed token exchange with the specified price.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_canceltradesbyprice" 31 "100.0" 1 "5.0"

func OmniCreatepayloadChangeissuer

func OmniCreatepayloadChangeissuer(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadChangeissuer Creates the payload to change the issuer on record of the given tokens. $ omnicore-cli "omni_createpayload_changeissuer" 3

func OmniCreatepayloadClosecrowdsale

func OmniCreatepayloadClosecrowdsale(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadClosecrowdsale Creates the payload to manually close a crowdsale. $ omnicore-cli "omni_createpayload_closecrowdsale" 70

func OmniCreatepayloadDexaccept

func OmniCreatepayloadDexaccept(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadDexaccept Create the payload for an accept offer for the specified token and amount.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_dexaccept" 1 "15.0"

func OmniCreatepayloadDexsell

func OmniCreatepayloadDexsell(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadDexsell Create a payload to place, update or cancel a sell offer on the traditional distributed OMNI/BTC exchange. $ omnicore-cli "omni_createpayload_dexsell" 1 "1.5" "0.75" 25 "0.0005" 1

func OmniCreatepayloadDisablefreezing

func OmniCreatepayloadDisablefreezing(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadDisablefreezing Creates the payload to disable address freezing for a centrally managed property.,IMPORTANT NOTE: Disabling freezing for a property will UNFREEZE all frozen addresses for that property! $ omnicore-cli "omni_createpayload_disablefreezing" 3

func OmniCreatepayloadEnablefreezing

func OmniCreatepayloadEnablefreezing(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadEnablefreezing Creates the payload to enable address freezing for a centrally managed property. $ omnicore-cli "omni_createpayload_enablefreezing" 3

func OmniCreatepayloadFreeze

func OmniCreatepayloadFreeze(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadFreeze Creates the payload to freeze an address for a centrally managed token.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_freeze" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 31 "100"

func OmniCreatepayloadGrant

func OmniCreatepayloadGrant(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadGrant Creates the payload to issue or grant new units of managed tokens.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_grant" 51 "7000"

func OmniCreatepayloadIssuancecrowdsale

func OmniCreatepayloadIssuancecrowdsale(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadIssuancecrowdsale Creates the payload for a new tokens issuance with crowdsale. $ omnicore-cli "omni_createpayload_issuancecrowdsale" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" "" 2 "100" 1483228800 30 2

func OmniCreatepayloadIssuancemanaged

func OmniCreatepayloadIssuancemanaged(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadIssuancemanaged Creates the payload for a new tokens issuance with manageable supply. $ omnicore-cli "omni_createpayload_issuancemanaged" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" ""

func OmniCreatepayloadRevoke

func OmniCreatepayloadRevoke(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadRevoke Creates the payload to revoke units of managed tokens.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units!f $ omnicore-cli "omni_createpayload_revoke" 51 "100"

func OmniCreatepayloadSendall

func OmniCreatepayloadSendall(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadSendall Create the payload for a send all transaction. $ omnicore-cli "omni_createpayload_sendall" 2

func OmniCreatepayloadSimplesend

func OmniCreatepayloadSimplesend(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadSimplesend Create the payload for a simple send transaction.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_simplesend" 1 "100.0"

func OmniCreatepayloadSto

func OmniCreatepayloadSto(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadSto Creates the payload for a send-to-owners transaction.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_sto" 3 "5000"

func OmniCreatepayloadTrade

func OmniCreatepayloadTrade(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadTrade Creates the payload to place a trade offer on the distributed token exchange.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_trade" 31 "250.0" 1 "10.0"

func OmniCreatepayloadUnfreeze

func OmniCreatepayloadUnfreeze(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreatepayloadUnfreeze Creates the payload to unfreeze an address for a centrally managed token.,Note: if the server is not synchronized, amounts are considered as divisible, even if the token may have indivisible units! $ omnicore-cli "omni_createpayload_unfreeze" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 31 "100"

func OmniCreaterawtxChange

func OmniCreaterawtxChange(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreaterawtxChange Adds a change output to the transaction.,The provided inputs are not added to the transaction, but only used to determine the change. It is assumed that the inputs were previously added, for example via `"createrawtransaction"`.,Optionally a position can be provided, where the change output should be inserted, starting with `0`. If the number of outputs is smaller than the position, then the change output is added to the end. Change outputs should be inserted before reference outputs, and as per default, the change output is added to the`first position.,If the change amount would be considered as dust, then no change output is added. $ omnicore-cli "omni_createrawtx_change" \ "0100000001b15ee60431ef57ec682790dec5a3c0d83a0c360633ea8308fbf6d5fc10a779670400000000ffffffff025c0d00000 \ 000000047512102f3e471222bb57a7d416c82bf81c627bfcd2bdc47f36e763ae69935bba4601ece21021580b888ff56feb27f17f \ 08802ebed26258c23697d6a462d43fc13b565fda2dd52aeaa0a0000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2 \ 339d24288ac00000000" \ "[{\"txid\":\"6779a710fcd5f6fb0883ea3306360c3ad8c0a3c5de902768ec57ef3104e65eb1\",\"vout\":4, \ \"scriptPubKey\":\"76a9147b25205fd98d462880a3e5b0541235831ae959e588ac\",\"value\":0.00068257}]" \ "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" 0.000035 1

func OmniCreaterawtxInput

func OmniCreaterawtxInput(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreaterawtxInput Adds a transaction input to the transaction.,If no raw transaction is provided, a new transaction is created. $ omnicore-cli "omni_createrawtx_input" \ "01000000000000000000" "b006729017df05eda586df9ad3f8ccfee5be340aadf88155b784d1fc0e8342ee" 0

func OmniCreaterawtxMultisig

func OmniCreaterawtxMultisig(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreaterawtxMultisig Adds a payload with class B (bare-multisig) encoding to the transaction.,If no raw transaction is provided, a new transaction is created.,If the data encoding fails, then the transaction is not modified. $ omnicore-cli "omni_createrawtx_multisig" \ "0100000001a7a9402ecd77f3c9f745793c9ec805bfa2e14b89877581c734c774864247e6f50400000000ffffffff01aa0a00000 \ 00000001976a9146d18edfe073d53f84dd491dae1379f8fb0dfe5d488ac00000000" \ "00000000000000020000000000989680" "1LifmeXYHeUe2qdKWBGVwfbUCMMrwYtoMm" \ "0252ce4bdd3ce38b4ebbc5a6e1343608230da508ff12d23d85b58c964204c4cef3"

func OmniCreaterawtxOpreturn

func OmniCreaterawtxOpreturn(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreaterawtxOpreturn Adds a payload with class C (op-return) encoding to the transaction.,If no raw transaction is provided, a new transaction is created.,If the data encoding fails, then the transaction is not modified. $ omnicore-cli "omni_createrawtx_opreturn" "01000000000000000000" "00000000000000020000000006dac2c0"

func OmniCreaterawtxReference

func OmniCreaterawtxReference(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniCreaterawtxReference Adds a reference output to the transaction.,If no raw transaction is provided, a new transaction is created.,The output value is set to at least the dust threshold. $ omnicore-cli "omni_createrawtx_reference" \ "0100000001a7a9402ecd77f3c9f745793c9ec805bfa2e14b89877581c734c774864247e6f50400000000ffffffff03aa0a00000 00000001976a9146d18edfe073d53f84dd491dae1379f8fb0dfe5d488ac5c0d0000000000004751210252ce4bdd3ce38b4ebbc5a 6e1343608230da508ff12d23d85b58c964204c4cef3210294cc195fc096f87d0f813a337ae7e5f961b1c8a18f1f8604a909b3a51 21f065b52aeaa0a0000000000001976a914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac00000000" \ "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" \ 0.005

func OmniDecodetransaction

func OmniDecodetransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniDecodetransaction Decodes an Omni transaction.,If the inputs of the transaction are not in the chain, then they must be provided, because the transaction inputs are used to identify the sender of a transaction.,A block height can be provided, which is used to determine the parsing rules. $ omnicore-cli "omni_decodetransaction" "010000000163af14ce6d477e1c793507e32a5b7696288fa89705c0d02a3f66beb3c \ 5b8afee0100000000ffffffff02ac020000000000004751210261ea979f6a06f9dafe00fb1263ea0aca959875a7073556a088cdf \ adcd494b3752102a3fd0a8a067e06941e066f78d930bfc47746f097fcd3f7ab27db8ddf37168b6b52ae22020000000000001976a \ 914946cb2e08075bcbaf157e47bcb67eb2b2339d24288ac00000000" \ "[{\"txid\":\"eeafb8c5b3be663f2ad0c00597a88f2896765b2ae30735791c7e476dce14af63\",\"vout\":1, \ \"scriptPubKey\":\"76a9149084c0bd89289bc025d0264f7f23148fb683d56c88ac\",\"value\":0.0001123}]"

func OmniFundedSend

func OmniFundedSend(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniFundedSend Creates and sends a funded simple send transaction.,All bitcoins from the sender are consumed and if there are bitcoins missing, they are taken from the specified fee source. Change is sent to the fee source! $ omnicore-cli "omni_funded_send" "1DFa5bT6KMEr6ta29QJouainsjaNBsJQhH" \ "15cWrfuvMxyxGst2FisrQcvcpF48x6sXoH" 1 "100.0" \ "15Jhzz4omEXEyFKbdcccJwuVPea5LqsKM1"

func OmniFundedSendall

func OmniFundedSendall(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniFundedSendall Creates and sends a transaction that transfers all available tokens in the given ecosystem to the recipient.,All bitcoins from the sender are consumed and if there are bitcoins missing, they are taken from the specified fee source. Change is sent to the fee source! $ omnicore-cli "omni_funded_sendall" "1DFa5bT6KMEr6ta29QJouainsjaNBsJQhH" \ "15cWrfuvMxyxGst2FisrQcvcpF48x6sXoH" 1 "15Jhzz4omEXEyFKbdcccJwuVPea5LqsKM1"

func OmniGetBlockInfo

func OmniGetBlockInfo(icmd interface{}, w *wallet.Wallet) (interface{}, error)

func OmniGetactivations

func OmniGetactivations(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetactivations Returns pending and completed feature activations. $ omnicore-cli "omni_getactivations"

func OmniGetactivecrowdsales

func OmniGetactivecrowdsales(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetactivecrowdsales Lists currently active crowdsales. $ omnicore-cli "omni_getactivecrowdsales"

func OmniGetactivedexsells

func OmniGetactivedexsells(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetactivedexsells Returns currently active offers on the distributed exchange. $ omnicore-cli "omni_getactivedexsells"

func OmniGetallbalancesforaddress

func OmniGetallbalancesforaddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetallbalancesforaddress Returns a list of all token balances for a given address. $ omnicore-cli "omni_getallbalancesforaddress" "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"

func OmniGetallbalancesforid

func OmniGetallbalancesforid(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetallbalancesforid Returns a list of token balances for a given currency or property identifier. $ omnicore-cli "omni_getallbalancesforid" 1

func OmniGetbalance

func OmniGetbalance(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetbalance Returns the token balance for a given address and property. $ omnicore-cli "omni_getbalance", "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P" 1

func OmniGetcrowdsale

func OmniGetcrowdsale(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetcrowdsale Returns information about a crowdsale. $ omnicore-cli "omni_getcrowdsale" 3 true

func OmniGetcurrentconsensushash

func OmniGetcurrentconsensushash(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetcurrentconsensushash Returns the consensus hash covering the state of the current block. $ omnicore-cli "omni_getcurrentconsensushash"

func OmniGetfeecache

func OmniGetfeecache(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetfeecache Obtains the current amount of fees cached (pending distribution).,If a property ID is supplied the results will be filtered to show this property ID only. If no property ID is supplied the results will contain all properties that currently have fees cached pending distribution. $ omnicore-cli "omni_getfeecache" 31

func OmniGetfeedistribution

func OmniGetfeedistribution(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetfeedistribution Obtains data for a past distribution of fees.,A distribution ID must be supplied to identify the distribution to obtain data for. $ omnicore-cli "omni_getfeedistribution" 1

func OmniGetfeedistributions

func OmniGetfeedistributions(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetfeedistributions Obtains data for past distributions of fees for a property.,A property ID must be supplied to retrieve past distributions for. $ omnicore-cli "omni_getfeedistributions" 31

func OmniGetfeeshare

func OmniGetfeeshare(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetfeeshare Obtains the current percentage share of fees addresses would receive if a distribution were to occur.,If an address is supplied the results will be filtered to show this address only. If no address is supplied the results will be filtered to show wallet addresses only. If a wildcard is provided (```"*"```) the results will contain all addresses that would receive a share.,If an ecosystem is supplied the results will reflect the fee share for that ecosystem (main or test). If no ecosystem is supplied the results will reflect the main ecosystem. $ omnicore-cli "omni_getfeeshare" "1CE8bBr1dYZRMnpmyYsFEoexa1YoPz2mfB" 1

func OmniGetfeetrigger

func OmniGetfeetrigger(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetfeetrigger Obtains the amount at which cached fees will be distributed.,If a property ID is supplied the results will be filtered to show this property ID only. If no property ID is supplied the results will contain all properties. $ omnicore-cli "omni_getfeetrigger" 31

func OmniGetgrants

func OmniGetgrants(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetgrants Returns information about granted and revoked units of managed tokens. $ omnicore-cli "omni_getgrants" 31

func OmniGetinfo

func OmniGetinfo(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetinfo Returns various state information of the client and protocol. $ omnicore-cli "omni_getinfo"

func OmniGetorderbook

func OmniGetorderbook(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetorderbook List active offers on the distributed token exchange. $ omnicore-cli "omni_getorderbook" 2

func OmniGetpayload

func OmniGetpayload(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetpayload Get the payload for an Omni transaction. $ omnicore-cli "omni_getactivations" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

func OmniGetproperty

func OmniGetproperty(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetproperty Returns details for about the tokens or smart property to lookup. $ omnicore-cli "omni_getproperty" 3

func OmniGetseedblocks

func OmniGetseedblocks(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetseedblocks Returns a list of blocks containing Omni transactions for use in seed block filtering.,WARNING: The Exodus crowdsale is not stored in LevelDB, thus this is currently only safe to use to generate seed blocks after block 255365. $ omnicore-cli "omni_getseedblocks" 290000 300000

func OmniGetsto

func OmniGetsto(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetsto Get information and recipients of a send-to-owners transaction. $ omnicore-cli "omni_getsto" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" "*"

func OmniGettrade

func OmniGettrade(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGettrade Get detailed information and trade matches for orders on the distributed token exchange. $ omnicore-cli "omni_gettrade" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

func OmniGettradehistoryforaddress

func OmniGettradehistoryforaddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGettradehistoryforaddress Retrieves the history of orders on the distributed exchange for the supplied address. $ omnicore-cli "omni_gettradehistoryforaddress" "1MCHESTptvd2LnNp7wmr2sGTpRomteAkq8"

func OmniGettradehistoryforpair

func OmniGettradehistoryforpair(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGettradehistoryforpair Retrieves the history of trades on the distributed token exchange for the specified market. $ omnicore-cli "omni_gettradehistoryforpair" 1 12 500

func OmniGettransaction

func OmniGettransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGettransaction Get detailed information about an Omni transaction. $ omnicore-cli "omni_gettransaction" "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"

func OmniGetwalletaddressbalances

func OmniGetwalletaddressbalances(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetwalletaddressbalances Returns a list of all token balances for every wallet address. $ omnicore-cli "omni_getwalletaddressbalances"

func OmniGetwalletbalances

func OmniGetwalletbalances(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniGetwalletbalances Returns a list of the total token balances of the whole wallet. $ omnicore-cli "omni_getwalletbalances"

func OmniListblocktransactions

func OmniListblocktransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniListblocktransactions Lists all Omni transactions in a block. $ omnicore-cli "omni_listblocktransactions" 279007

func OmniListpendingtransactions

func OmniListpendingtransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniListpendingtransactions Returns a list of unconfirmed Omni transactions, pending in the memory pool.,Note: the validity of pending transactions is uncertain, and the state of the memory pool may change at any moment. It is recommended to check transactions after confirmation, and pending transactions should be considered as invalid. $ omnicore-cli "omni_listpendingtransactions"

func OmniListproperties

func OmniListproperties(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniListproperties Lists all tokens or smart properties. $ omnicore-cli "omni_listproperties"

func OmniListtransactions

func OmniListtransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniListtransactions List wallet transactions, optionally filtered by an address and block boundaries. $ omnicore-cli "omni_listtransactions"

func OmniListwallettransactions

func OmniListwallettransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniListwallettransactions Returns a list of the total token balances of the whole wallet. $ omnicore-cli "omni_listwallettransactions"

func OmniReadAllTxHash

func OmniReadAllTxHash(icmd interface{}, w *wallet.Wallet) (interface{}, error)

func OmniRollBack

func OmniRollBack(icmd interface{}, w *wallet.Wallet) (interface{}, error)

func OmniSend

func OmniSend(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSend Create and broadcast a simple send transaction. $ omnicore-cli "omni_send" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "100.0"

func OmniSendAgreement

func OmniSendAgreement(icmd interface{}, w *wallet.Wallet) (interface{}, error)

func OmniSendall

func OmniSendall(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendall Transfers all available tokens in the given ecosystem to the recipient. $ omnicore-cli "omni_sendall" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 2

func OmniSendcancelalltrades

func OmniSendcancelalltrades(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendcancelalltrades Cancel all offers on the distributed token exchange. $ omnicore-cli "omni_sendcancelalltrades" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 1

func OmniSendcanceltradesbypair

func OmniSendcanceltradesbypair(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendcanceltradesbypair Cancel all offers on the distributed token exchange with the given currency pair. $ omnicore-cli "omni_sendcanceltradesbypair" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 1 31

func OmniSendcanceltradesbyprice

func OmniSendcanceltradesbyprice(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendcanceltradesbyprice Cancel offers on the distributed token exchange with the specified price. $ omnicore-cli "omni_sendcanceltradesbyprice" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 31 "100.0" 1 "5.0"

func OmniSendchangeissuer

func OmniSendchangeissuer(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendchangeissuer Change the issuer on record of the given tokens. $ omnicore-cli "omni_sendchangeissuer" \ "1ARjWDkZ7kT9fwjPrjcQyvbXDkEySzKHwu" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 3

func OmniSendclosecrowdsale

func OmniSendclosecrowdsale(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendclosecrowdsale Manually close a crowdsale. $ omnicore-cli "omni_sendclosecrowdsale" "3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo" 70

func OmniSenddexaccept

func OmniSenddexaccept(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSenddexaccept Create and broadcast an accept offer for the specified token and amount. $ omnicore-cli "omni_senddexaccept" \ "35URq1NN3xL6GeRKUP6vzaQVcxoJiiJKd8" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "15.0"

func OmniSenddexsell

func OmniSenddexsell(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSenddexsell Place, update or cancel a sell offer on the traditional distributed OMNI/BTC exchange. $ omnicore-cli "omni_senddexsell" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 1 "1.5" "0.75" 25 "0.0005" 1

func OmniSenddisablefreezing

func OmniSenddisablefreezing(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSenddisablefreezing Disables address freezing for a centrally managed property.,IMPORTANT NOTE: Disabling freezing for a property will UNFREEZE all frozen addresses for that property! $ omnicore-cli "omni_senddisablefreezing" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" 2

func OmniSendenablefreezing

func OmniSendenablefreezing(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendenablefreezing Enables address freezing for a centrally managed property. $ omnicore-cli "omni_sendenablefreezing" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" 2

func OmniSendfreeze

func OmniSendfreeze(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendfreeze Freeze an address for a centrally managed token.,Note: Only the issuer may freeze tokens, and only if the token is of the managed type with the freezing option enabled. $ omnicore-cli "omni_sendfreeze" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 2 1000

func OmniSendgrant

func OmniSendgrant(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendgrant Issue or grant new units of managed tokens. $ omnicore-cli "omni_sendgrant" "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" "" 51 "7000"

func OmniSendissuancecrowdsale

func OmniSendissuancecrowdsale(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendissuancecrowdsale Create new tokens as crowdsale. $ omnicore-cli "omni_sendissuancecrowdsale" \ "3JYd75REX3HXn1vAU83YuGfmiPXW7BpYXo" 2 1 0 "Companies" "Bitcoin Mining" \ "Quantum Miner" "" "" 2 "100" 1483228800 30 2

func OmniSendissuancefixed

func OmniSendissuancefixed(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendissuancefixed Create new tokens with fixed supply. $ omnicore-cli "omni_sendissuancefixed" \ "3Ck2kEGLJtZw9ENj2tameMCtS3HB7uRar3" 2 1 0 "Companies" "Bitcoin Mining" \ "Quantum Miner" "" "" "1000000"

func OmniSendissuancemanaged

func OmniSendissuancemanaged(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendissuancemanaged Create new tokens with manageable supply. $ omnicore-cli "omni_sendissuancemanaged" \ "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" 2 1 0 "Companies" "Bitcoin Mining" "Quantum Miner" "" ""

func OmniSendrawtx

func OmniSendrawtx(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendrawtx Broadcasts a raw Omni Layer transaction. $ omnicore-cli "omni_sendrawtx" \ "1MCHESTptvd2LnNp7wmr2sGTpRomteAkq8" "000000000000000100000000017d7840" \ "1EqTta1Rt8ixAA32DuC29oukbsSWU62qAV"

func OmniSendrevoke

func OmniSendrevoke(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendrevoke Revoke units of managed tokens. $ omnicore-cli "omni_sendrevoke" "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" "" 51 "100"

func OmniSendsto

func OmniSendsto(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendsto Create and broadcast a send-to-owners transaction. $ omnicore-cli "omni_sendsto" \ "32Z3tJccZuqQZ4PhJR2hxHC3tjgjA8cbqz" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 3 "5000"

func OmniSendtrade

func OmniSendtrade(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendtrade Place a trade offer on the distributed token exchange. $ omnicore-cli "omni_sendtrade" "3BydPiSLPP3DR5cf726hDQ89fpqWLxPKLR" 31 "250.0" 1 "10.0"

func OmniSendunfreeze

func OmniSendunfreeze(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSendunfreeze Unfreeze an address for a centrally managed token.,Note: Only the issuer may unfreeze tokens $ omnicore-cli "omni_sendunfreeze" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "3HTHRxu3aSDV4deakjC7VmsiUp7c6dfbvs" 2 1000

func OmniSetautocommit

func OmniSetautocommit(icmd interface{}, w *wallet.Wallet) (interface{}, error)

OmniSetautocommit Sets the global flag that determines whether transactions are automatically committed and broadcasted. $ omnicore-cli "omni_setautocommit" false

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger sets the package-wide logger. Any calls to this function must be made before a server is created and used (it is not concurrent safe).

Types

type DeserializationError

type DeserializationError struct {
	// contains filtered or unexported fields
}

DeserializationError describes a failed deserializaion due to bad user input. It corresponds to hcjson.ErrRPCDeserialization.

type InvalidParameterError

type InvalidParameterError struct {
	// contains filtered or unexported fields
}

InvalidParameterError describes an invalid parameter passed by the user. It corresponds to hcjson.ErrRPCInvalidParameter.

type LegacyRpcHandler

type LegacyRpcHandler struct {
	// contains filtered or unexported fields
}

type Options

type Options struct {
	Username string
	Password string

	MaxPOSTClients      int64
	MaxWebsocketClients int64
}

Options contains the required options for running the legacy RPC server.

type ParseError

type ParseError struct {
	// contains filtered or unexported fields
}

ParseError describes a failed parse due to bad user input. It corresponds to hcjson.ErrRPCParse.

type SendFromAddressToAddress

type SendFromAddressToAddress struct {
	FromAddress   string
	ToAddress     string
	ChangeAddress string
	Amount        float64
	Comment       *string
	CommentTo     *string
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server holds the items the RPC server may need to access (auth, config, shutdown, etc.)

func NewServer

func NewServer(opts *Options, activeNet *chaincfg.Params, walletLoader *loader.Loader, listeners []net.Listener) *Server

NewServer creates a new server for serving legacy RPC client connections, both HTTP POST and websocket.

func (*Server) JsonCmdReqOmToHc

func (s *Server) JsonCmdReqOmToHc(strRequst string) (string, error)

add by ycj 20180910 for handle request,refer:func postClientRPC

func (*Server) RequestProcessShutdown

func (s *Server) RequestProcessShutdown() <-chan struct{}

RequestProcessShutdown returns a channel that is sent to when an authorized client requests remote shutdown.

func (*Server) SetChainServer

func (s *Server) SetChainServer(chainClient *chain.RPCClient)

SetChainServer sets the chain server client component needed to run a fully functional hcd wallet RPC server. This can be called to enable RPC passthrough even before a loaded wallet is set, but the wallet's RPC client is preferred.

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully shuts down the rpc server by stopping and disconnecting all clients, disconnecting the chain server connection, and closing the wallet's account files. This blocks until shutdown completes.

Jump to

Keyboard shortcuts

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