consts

package
v0.0.0-...-485d38d Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const AccessKeyDisabledStatus = "disabled" // the access key has been disabled - eg temporarily made unavailable. This can be used when maintenance is occuring on the Enu application
View Source
const AccessKeyInvalidStatus = "invalid" // the access key has been made revoked and can no longer be used
View Source
const AccessKeyKey key = 1
View Source
const AccessKeyValidStatus = "valid" // normal status
View Source
const BlockchainIdKey key = 3
View Source
const ColoredCoinsBlockchainId string = "coloredcoins"
View Source
const CounterpartyAddressActivationAmount = 100 // Number of transactions to activate Counterparty addresses by default
View Source
const CounterpartyBlockchainId string = "counterparty"
View Source
const CounterpartylibInsufficientBTC = "Insufficient BTC at address"
View Source
const CounterpartylibInsufficientFunds = "insufficient funds"
View Source
const CounterpartylibMalformedAddress = "Odd-length string"
View Source
const CounterpartylibOnlyIssuerCanPayDividends = "only issuer can pay dividends"
View Source
const CountpartylibMempoolIsNotReady = "Mempool is not yet ready"
View Source
const CountpartylibNoSuchAsset = "no such asset"
View Source
const EnvKey key = 5
View Source
const LOGDEBUG = "DEBUG"
View Source
const LOGERROR = "ERROR"
View Source
const LOGEVENT = "EVENT" // Something occured which would impact the account of the user. ie activation of an address or successful completion of an API call
View Source
const LOGINFO = "INFO"
View Source
const NonceIntKey key = 2
View Source
const NotFound = "Not found"
View Source
const RequestIdKey key = 0
View Source
const RequestTypeKey key = 4
View Source
const RippleAddressActivationAmount = 100 // Number of transactions to activate Counterparty addresses by default
View Source
const RippleBlockchainId string = "ripple"
View Source
const Satoshi = 100000000 // Default divisibility for Counterparty assets which are divisible
View Source
const SqlNotFound = "sql: no rows in result set"

Variables

View Source
var CounterpartyErrors = CounterpartyStruct{
	MiscError:                 ErrCodes{1000, "Misc error when contacting Counterparty. Please contact Vennd.io support."},
	Timeout:                   ErrCodes{1001, "Timeout when contacting Counterparty. Please try again later."},
	ReparsingOrUnavailable:    ErrCodes{1002, "Counterparty Blockchain temporarily unavailable. Please try again later."},
	SigningError:              ErrCodes{1003, "Unable to sign transaction. Is your passphrase correct?"},
	BroadcastError:            ErrCodes{1004, "Unable to broadcast transaction to the blockchain. Please try the transaction again."},
	InsufficientFees:          ErrCodes{1005, "Insufficient BTC in address to perform transaction. Please use the Activate() call to add more BTC."},
	DividendNotFound:          ErrCodes{1007, "The dividend could not be found."},
	ComposeError:              ErrCodes{1008, "Unable to create the blockchain transaction."},
	InsufficientFunds:         ErrCodes{1009, "Insufficient asset in this address."},
	MalformedAddress:          ErrCodes{1010, "One of the addresses provided was not correct. Please check the addresses involved in the transaction."},
	OnlyIssuerCanPayDividends: ErrCodes{1011, "Only the issuer may pay dividends."},
	NoSuchAsset:               ErrCodes{1012, "The asset specified is incorrect or doesn't exist."},
}
View Source
var GenericErrors = GenericStruct{
	InvalidDocument:       ErrCodes{1, "There was a problem with the parameters in your JSON request. Please correct the request."},
	InvalidDividendId:     ErrCodes{2, "The specified dividend id is invalid."},
	UnsupportedBlockchain: ErrCodes{3, "The specified blockchain is not supported."},
	HeadersIncorrect:      ErrCodes{4, "Request headers were not set correctly ensure the following headers are set: accessKey and signature."},
	UnknownAccessKey:      ErrCodes{5, "Attempt to access API with unknown user key"},
	InvalidSignature:      ErrCodes{6, "Could not verify HMAC signature"},
	InvalidNonce:          ErrCodes{7, "Invalid nonce"},
	NotFound:              ErrCodes{8, "Not found"},
	FunctionNotAvailable:  ErrCodes{9, "The function is not available on the selected blockchain."},
	InvalidPassphrase:     ErrCodes{10, "The passphrase provided is not valid."},
	InvalidAssetId:        ErrCodes{11, "The specified asset id is invalid."},
	InvalidPaymentId:      ErrCodes{12, "The specified paymentId is invalid. Please correct the paymentId and resubmit."},
	GeneralError:          ErrCodes{13, "Misc error. Please contact Vennd.io support."},
	InvalidAddress:        ErrCodes{14, "The specified address is invalid. Please correct the address and resubmit."},
	InvalidAsset:          ErrCodes{15, "The specified asset is invalid. Please correct the asset and resubmit."},
	ApiKeyDisabled:        ErrCodes{16, "The specified API is valid. However it has been disabled by an administrator."},
}
View Source
var ParameterValidations = map[string]Validations{
	"counterparty": {
		"asset":           `{"properties":{"blockchainId":{"type":"string"},"passphrase":{"type":"string"},"distributionAddress":{"type":"string","maxLength":34,"minLength":34},"distributionPassphrase":{"type":"string"},"description":{"type":"string"},"asset":{"type":"string","minLength":4},"quantity":{"type":"integer"},"divisible":{"type":"boolean"},"nonce":{"type":"integer"}},"required":["sourceAddress","passphrase","asset","quantity","divisible"]}`,
		"dividend":        `{"properties":{"blockchainId":{"type":"string"},"sourceAddress":{"type":"string","maxLength":34,"minLength":34},"asset":{"type":"string","minLength":4},"dividendAsset":{"type":"string"},"quantityPerUnit":{"type":"integer"},"nonce":{"type":"integer"}},"required":["sourceAddress","asset","dividendAsset","quantityPerUnit"]}`,
		"walletCreate":    `{"properties":{"blockchainId":{"type":"string"},"numberOfAddresses":{"type":"number","minimum":1,"maximum":100,"exclusiveMaximum":false},"nonce":{"type":"integer"}}}`,
		"walletPayment":   `{"properties":{"blockchainId":{"type":"string"},"sourceAddress":{"type":"string","maxLength":34,"minLength":34},"destinationAddress":{"type":"string","maxLength":34,"minLength":34},"asset":{"type":"string","minLength":4},"quantity":{"type":"integer"},"nonce":{"type":"integer"}},"required":["sourceAddress","asset","quantity","destinationAddress"]}`,
		"simplePayment":   `{"properties":{"sourceAddress":{"type":"string", "maxLength":34, "minLength":34},"destinationAddress":{"type":"string", "maxLength":34, "minLength":34},"asset":{"type":"string","minLength":4},"amount":{"type":"integer"},"txFee":{"type":"integer"}},"required":["sourceAddress","destinationAddress","asset","amount"]}`,
		"activateaddress": `{"properties":{"blockchainId":{"type":"string"},"address":{"type":"string","maxLength":34,"minLength":34},"amount":{"type":"integer"},"nonce":{"type":"integer"}},"required":["address","amount"]}`,
	},
	"ripple": {
		"asset":           `{"properties":{"blockchainId":{"type":"string"},"passphrase":{"type":"string"},"distributionAddress":{"type":"string"},"distributionPassphrase":{"type":"string"},"description":{"type":"string"},"asset":{"type":"string","minLength":4},"quantity":{"type":"integer"},"divisible":{"type":"boolean"},"nonce":{"type":"integer"}},"required":["sourceAddress","passphrase","asset","quantity","divisible"]}`,
		"walletCreate":    `{"properties":{"blockchainId":{"type":"string"},"nonce":{"type":"integer"}}}`,
		"walletPayment":   `{"properties":{"blockchainId":{"type":"string"},"sourceAddress":{"type":"string"},"destinationAddress":{"type":"string"},"asset":{"type":"string","minLength":3},"quantity":{"type":"integer"},"nonce":{"type":"integer"}},"required":["sourceAddress","asset","quantity","destinationAddress"]}`,
		"activateaddress": `{"properties":{"blockchainId":{"type":"string"},"address":{"type":"string"},"passphrase":{"type":"string"},"amount":{"type":"integer"},"assets":{"type":"array", "items": [{"type":"object","properties":{"currency":{"type":"string"},"issuer":{"type":"string"}}}]},"nonce":{"type":"integer"}},"required":["address","amount"]}`,
	},
}

cf http://spacetelescope.github.io/understanding-json-schema/

View Source
var RippleErrors = RippleStruct{
	MiscError:                     ErrCodes{2000, "Misc error when contacting Ripple. Please contact Vennd.io support."},
	Timeout:                       ErrCodes{2001, "Timeout when contacting Ripple. Please try again later."},
	InvalidAmount:                 ErrCodes{2002, "The amount specified is not a valid amount."},
	InvalidCurrency:               ErrCodes{2003, "The currency is invalid. Ripple currencies must be 3 characters or longer."},
	SubmitError:                   ErrCodes{2004, "The Ripple node rejected the transaction submission. Please try again."},
	IssuerMustBeGiven:             ErrCodes{2005, "If the currency is not XRP the issuer must be provided."},
	SigningError:                  ErrCodes{2006, "Unable to sign transaction. Is your passphrase correct?"},
	SubmitErrorFeeLost:            ErrCodes{2007, "The transaction was submitted to the Ripple network but was invalid."},
	InvalidCurrencyOrNoTrustline:  ErrCodes{2008, "The specified asset is invalid or you must activate the destination wallet to accept the asset."},
	InvalidSource:                 ErrCodes{2009, "The specified source address is invalid."},
	InvalidDestination:            ErrCodes{2010, "The specified destination address is invalid."},
	DistributionPassphraseMissing: ErrCodes{2011, "If a distribution address is specified the passphrase for the distribution address must be given."},
	DistributionInsufficientFunds: ErrCodes{2012, "The specified distribution address does not contain sufficient funds. Please activate the address and try again."},
	InsufficientXRP:               ErrCodes{2013, "There was insufficient XRP in the address to perform the payment. Please activate the address and try again."},
	UnableToGetLatestLedger:       ErrCodes{2014, "Unable to retrieve the latest ledger that Ripple has validated. Internal server error..."},
	QueuedNotAccepted:             ErrCodes{2015, "The transaction was queued due to esclation of transaction fees. However, it was not accepted after the maximum ledger sequence."},
}

Functions

This section is empty.

Types

type CounterpartyStruct

type CounterpartyStruct struct {
	MiscError                 ErrCodes
	Timeout                   ErrCodes
	ReparsingOrUnavailable    ErrCodes
	SigningError              ErrCodes
	BroadcastError            ErrCodes
	InsufficientFunds         ErrCodes
	InsufficientFees          ErrCodes
	InvalidPassphrase         ErrCodes
	DividendNotFound          ErrCodes
	ComposeError              ErrCodes
	MalformedAddress          ErrCodes
	OnlyIssuerCanPayDividends ErrCodes
	NoSuchAsset               ErrCodes
}

type ErrCodes

type ErrCodes struct {
	Code        int64
	Description string
}

type GenericStruct

type GenericStruct struct {
	InvalidDocument       ErrCodes
	InvalidDividendId     ErrCodes
	UnsupportedBlockchain ErrCodes
	HeadersIncorrect      ErrCodes
	UnknownAccessKey      ErrCodes
	InvalidSignature      ErrCodes
	InvalidNonce          ErrCodes
	NotFound              ErrCodes
	FunctionNotAvailable  ErrCodes
	InvalidPassphrase     ErrCodes
	InvalidAssetId        ErrCodes
	InvalidPaymentId      ErrCodes
	InvalidAddress        ErrCodes
	InvalidAsset          ErrCodes
	ApiKeyDisabled        ErrCodes

	GeneralError ErrCodes
}

type RippleStruct

type RippleStruct struct {
	MiscError                     ErrCodes
	Timeout                       ErrCodes
	InvalidAmount                 ErrCodes
	InvalidCurrency               ErrCodes
	SubmitError                   ErrCodes
	IssuerMustBeGiven             ErrCodes
	SigningError                  ErrCodes
	SubmitErrorFeeLost            ErrCodes
	InvalidCurrencyOrNoTrustline  ErrCodes
	InvalidSource                 ErrCodes
	InvalidDestination            ErrCodes
	DistributionPassphraseMissing ErrCodes
	DistributionInsufficientFunds ErrCodes
	InsufficientXRP               ErrCodes
	UnableToGetLatestLedger       ErrCodes
	QueuedNotAccepted             ErrCodes
}

type Validations

type Validations map[string]string

Jump to

Keyboard shortcuts

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