Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAndSetUlimit() error
- func EncodeCID(b []byte) (*cid.Cid, error)
- func EncodeMultihash(b []byte) (*mh.Multihash, error)
- func ExtractIDFromPointer(pi ps.PeerInfo) (string, error)
- func FormatRFC3339PB(ts google_protobuf.Timestamp) string
- func GetOrderQuantity(l *pb.Listing, item *pb.Order_Item) uint64
- func GetSelectedSku(listing *pb.Listing, itemOptions []*pb.Order_Item_Option) (int, error)
- func NormalizeCurrencyCode(currencyCode string) string
- func ParseContractForListing(hash string, contract *pb.RicardianContract) (*pb.Listing, error)
- func SameSku(selectedVariants []int, sku *pb.Listing_Item_Sku) bool
- func ValidShippingRegion(shippingOption *pb.Listing_ShippingOption) error
- func ValidateProfile(profile *pb.Profile) error
- func ValidateRating(rating *pb.Rating) (bool, error)
- type CodedError
- type ErrCryptocurrencyListingIllegalField
- type ErrCryptocurrencyPurchaseIllegalField
- type ErrMarketPriceListingIllegalField
- type ErrOutOfInventory
- type ErrPriceModifierOutOfRange
- type EvenNode
- func (n *EvenNode) BuildTransactionRecords(contract *pb.RicardianContract, records []*wallet.TransactionRecord, ...) ([]*pb.TransactionRecord, *pb.TransactionRecord, error)
- func (n *EvenNode) CalcOrderID(order *pb.Order) (string, error)
- func (n *EvenNode) CalculateOrderTotal(contract *pb.RicardianContract) (uint64, error)
- func (n *EvenNode) CancelOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
- func (n *EvenNode) CloseDispute(orderID string, buyerPercentage, vendorPercentage float32, resolution string, ...) error
- func (n *EvenNode) CompleteOrder(orderRatings *OrderRatings, contract *pb.RicardianContract, ...) error
- func (n *EvenNode) ConfirmOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
- func (n *EvenNode) CreateListing(listing *pb.Listing) error
- func (n *EvenNode) DeleteListing(slug string) error
- func (n *EvenNode) DeletePost(slug string) error
- func (n *EvenNode) DisputeIsActive(contract *pb.RicardianContract) (bool, error)
- func (n *EvenNode) EncryptMessage(peerID peer.ID, peerKey *libp2p.PubKey, message []byte) (ct []byte, rerr error)
- func (n *EvenNode) EstimateOrderTotal(data *PurchaseData) (uint64, error)
- func (n *EvenNode) FetchAvatar(peerID string, size string, useCache bool) (io.DagReader, error)
- func (n *EvenNode) FetchHeader(peerID string, size string, useCache bool) (io.DagReader, error)
- func (n *EvenNode) FetchImage(peerID string, imageType string, size string, useCache bool) (io.DagReader, error)
- func (n *EvenNode) FetchProfile(peerID string, useCache bool) (pb.Profile, error)
- func (n *EvenNode) Follow(peerID string) error
- func (n *EvenNode) FulfillOrder(fulfillment *pb.OrderFulfillment, contract *pb.RicardianContract, ...) error
- func (n *EvenNode) GeneratePostSlug(status string) (string, error)
- func (n *EvenNode) GenerateSlug(title string) (string, error)
- func (n *EvenNode) GetBase64Image(url string) (base64ImageData, filename string, err error)
- func (n *EvenNode) GetListingCount() int
- func (n *EvenNode) GetListingFromHash(hash string) (*pb.SignedListing, error)
- func (n *EvenNode) GetListingFromSlug(slug string) (*pb.SignedListing, error)
- func (n *EvenNode) GetListings() ([]byte, error)
- func (n *EvenNode) GetLocalInventory() (Inventory, error)
- func (n *EvenNode) GetLocalInventoryForSlug(slug string) (*InventoryListing, error)
- func (n *EvenNode) GetModeratorFee(transactionTotal uint64, paymentCoin, currencyCode string) (uint64, error)
- func (n *EvenNode) GetPeerStatus(peerID string) (string, error)
- func (n *EvenNode) GetPostCount() int
- func (n *EvenNode) GetPostFromHash(hash string) (*pb.SignedPost, error)
- func (n *EvenNode) GetPostFromSlug(slug string) (*pb.SignedPost, error)
- func (n *EvenNode) GetPosts() ([]byte, error)
- func (n *EvenNode) GetProfile() (pb.Profile, error)
- func (n *EvenNode) GetPublishedInventoryBytes(p peer.ID, useCache bool) ([]byte, error)
- func (n *EvenNode) GetPublishedInventoryBytesForSlug(p peer.ID, slug string, useCache bool) ([]byte, error)
- func (n *EvenNode) GetRatingCounts() (uint32, float32, error)
- func (n *EvenNode) IPFSIdentityString() string
- func (n *EvenNode) IPNSResolve(peerID string, timeout time.Duration, usecache bool) (string, error)
- func (n *EvenNode) IPNSResolveThenCat(ipnsPath ipfspath.Path, timeout time.Duration, usecache bool) ([]byte, error)
- func (n *EvenNode) ImportListings(r io.ReadCloser) error
- func (n *EvenNode) IsFulfilled(contract *pb.RicardianContract) bool
- func (n *EvenNode) IsItemForSale(listing *pb.Listing) bool
- func (n *EvenNode) IsModerator() bool
- func (n *EvenNode) NewOrderConfirmation(contract *pb.RicardianContract, addressRequest, calculateNewTotal bool) (*pb.RicardianContract, error)
- func (n *EvenNode) NotifyModerators(moderators []string) error
- func (n *EvenNode) OpenDispute(orderID string, contract *pb.RicardianContract, ...) error
- func (n *EvenNode) PatchProfile(patch map[string]interface{}) error
- func (n *EvenNode) ProcessDisputeOpen(rc *pb.RicardianContract, peerID string) error
- func (n *EvenNode) PublishInventory() error
- func (n *EvenNode) Purchase(data *PurchaseData) (orderID string, paymentAddress string, paymentAmount uint64, vendorOnline bool, ...)
- func (n *EvenNode) RefundOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
- func (n *EvenNode) RegressionNetworkEnabled() bool
- func (n *EvenNode) RejectOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
- func (n *EvenNode) ReleaseFunds(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
- func (n *EvenNode) ReleaseFundsAfterTimeout(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
- func (n *EvenNode) RemoveSelfAsModerator() error
- func (n *EvenNode) SeedNode() error
- func (n *EvenNode) SendBlock(peerID string, id cid.Cid) error
- func (n *EvenNode) SendCancel(peerID, orderID string) error
- func (n *EvenNode) SendChat(peerID string, chatMessage *pb.Chat) error
- func (n *EvenNode) SendDisputeClose(peerID string, k *libp2p.PubKey, resolutionMessage *pb.RicardianContract) error
- func (n *EvenNode) SendDisputeOpen(peerID string, k *libp2p.PubKey, disputeMessage *pb.RicardianContract) error
- func (n *EvenNode) SendDisputeUpdate(peerID string, updateMessage *pb.DisputeUpdate) error
- func (n *EvenNode) SendError(peerID string, k *libp2p.PubKey, errorMessage pb.Message) error
- func (n *EvenNode) SendFundsReleasedByVendor(peerID string, marshalledPeerPublicKey []byte, orderID string) error
- func (n *EvenNode) SendModeratorAdd(peerID string) error
- func (n *EvenNode) SendModeratorRemove(peerID string) error
- func (n *EvenNode) SendOfflineAck(peerID string, pointerID peer.ID) error
- func (n *EvenNode) SendOfflineMessage(p peer.ID, k *libp2p.PubKey, m *pb.Message) error
- func (n *EvenNode) SendOfflineRelay(peerID string, encryptedMessage []byte) error
- func (n *EvenNode) SendOrder(peerID string, contract *pb.RicardianContract) (resp *pb.Message, err error)
- func (n *EvenNode) SendOrderCompletion(peerID string, k *libp2p.PubKey, completionMessage *pb.RicardianContract) error
- func (n *EvenNode) SendOrderConfirmation(peerID string, contract *pb.RicardianContract) error
- func (n *EvenNode) SendOrderFulfillment(peerID string, k *libp2p.PubKey, fulfillmentMessage *pb.RicardianContract) error
- func (n *EvenNode) SendRefund(peerID string, refundMessage *pb.RicardianContract) error
- func (n *EvenNode) SendReject(peerID string, rejectMessage *pb.OrderReject) error
- func (n *EvenNode) SendStore(peerID string, ids []cid.Cid) error
- func (n *EvenNode) SetAvatarImages(base64ImageData string) (*pb.Profile_Image, error)
- func (n *EvenNode) SetHeaderImages(base64ImageData string) (*pb.Profile_Image, error)
- func (n *EvenNode) SetListingInventory(listing *pb.Listing) error
- func (n *EvenNode) SetModeratorsOnListings(moderators []string) error
- func (n *EvenNode) SetProductImages(base64ImageData, filename string) (*pb.Profile_Image, error)
- func (n *EvenNode) SetSelfAsModerator(moderator *pb.Moderator) error
- func (n *EvenNode) SetUpRepublisher(interval time.Duration)
- func (n *EvenNode) SignDispute(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) SignDisputeResolution(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) SignListing(listing *pb.Listing) (*pb.SignedListing, error)
- func (n *EvenNode) SignOrder(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) SignOrderCompletion(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) SignOrderConfirmation(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) SignOrderFulfillment(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) SignPost(post *pb.Post) (*pb.SignedPost, error)
- func (n *EvenNode) SignRefund(contract *pb.RicardianContract) (*pb.RicardianContract, error)
- func (n *EvenNode) Spend(args *SpendRequest) (*SpendResponse, error)
- func (n *EvenNode) StartMessageRetriever()
- func (n *EvenNode) StartPointerRepublisher()
- func (n *EvenNode) StartRecordAgingNotifier()
- func (n *EvenNode) TestNetworkEnabled() bool
- func (n *EvenNode) Unfollow(peerID string) error
- func (n *EvenNode) UpdateEachListingOnIndex(updateListing func(*ListingData) error) error
- func (n *EvenNode) UpdateFollow() error
- func (n *EvenNode) UpdateListing(listing *pb.Listing) error
- func (n *EvenNode) UpdatePostHashes(hashes map[string]string) error
- func (n *EvenNode) UpdatePostIndex(post *pb.SignedPost) error
- func (n *EvenNode) UpdateProfile(profile *pb.Profile) error
- func (n *EvenNode) ValidateAndSaveRating(contract *pb.RicardianContract) (retErr error)
- func (n *EvenNode) ValidateCaseContract(contract *pb.RicardianContract) []string
- func (n *EvenNode) ValidateDirectPaymentAddress(order *pb.Order) error
- func (n *EvenNode) ValidateDisputeResolution(contract *pb.RicardianContract) error
- func (n *EvenNode) ValidateModeratedPaymentAddress(order *pb.Order, timeout time.Duration) error
- func (n *EvenNode) ValidateMultiwalletHasPreferredCurrencies(data repo.SettingsData) error
- func (n *EvenNode) ValidateOrder(contract *pb.RicardianContract, checkInventory bool) error
- func (n *EvenNode) ValidateOrderCompletion(contract *pb.RicardianContract) error
- func (n *EvenNode) ValidateOrderConfirmation(contract *pb.RicardianContract, validateAddress bool) error
- func (n *EvenNode) ValidateOrderFulfillment(fulfillment *pb.OrderFulfillment, contract *pb.RicardianContract) error
- func (n *EvenNode) ValidatePaymentAmount(requestedAmount, paymentAmount uint64) bool
- func (n *EvenNode) VerifySignatureOnDisputeOpen(contract *pb.RicardianContract, peerID string) error
- func (n *EvenNode) VerifySignaturesOnRefund(contract *pb.RicardianContract) error
- func (n *EvenNode) WaitForMessageRetrieverCompletion()
- type Inventory
- type InventoryListing
- type ListingData
- type OrderRatings
- type PurchaseData
- type RatingData
- type SavedRating
- type SpendRequest
- type SpendResponse
Constants ¶
const ( // RatingMin - min raring RatingMin = 1 // RatingMax - max rating RatingMax = 5 // ReviewMaxCharacters - max size for review ReviewMaxCharacters = 3000 )
const ( // VERSION - current version VERSION = "0.13.0" // USERAGENT - user-agent header string USERAGENT = "/openbazaar-go:" + VERSION + "/" )
const ( // ListingVersion - current listing version ListingVersion = 4 // TitleMaxCharacters - max size for title TitleMaxCharacters = 140 // ShortDescriptionLength - min length for description ShortDescriptionLength = 160 // DescriptionMaxCharacters - max length for description DescriptionMaxCharacters = 50000 // MaxTags - max permitted tags MaxTags = 10 // MaxCategories - max permitted categories MaxCategories = 10 // MaxListItems - max items in a listing MaxListItems = 30 // FilenameMaxCharacters - max filename size FilenameMaxCharacters = 255 // CodeMaxCharacters - max chars for a code CodeMaxCharacters = 20 // WordMaxCharacters - max chars for word WordMaxCharacters = 40 // SentenceMaxCharacters - max chars for sentence SentenceMaxCharacters = 70 // CouponTitleMaxCharacters - max length of a coupon title CouponTitleMaxCharacters = 70 // PolicyMaxCharacters - max length for policy PolicyMaxCharacters = 10000 // AboutMaxCharacters - max length for about AboutMaxCharacters = 10000 // URLMaxCharacters - max length for URL URLMaxCharacters = 2000 // MaxCountryCodes - max country codes MaxCountryCodes = 255 // EscrowTimeout - escrow timeout in hours EscrowTimeout = 1080 // SlugBuffer - buffer size for slug SlugBuffer = 5 // PriceModifierMin - min price modifier PriceModifierMin = -99.99 // PriceModifierMax = max price modifier PriceModifierMax = 1000.00 )
const ( // ChatMessageMaxCharacters - limit for chat msg ChatMessageMaxCharacters = 20000 // ChatSubjectMaxCharacters - limit for chat subject ChatSubjectMaxCharacters = 500 // DefaultPointerPrefixLength - default ipfs pointer prefix DefaultPointerPrefixLength = 14 )
const ( // EscrowReleaseSize - size in bytes for escrow op EscrowReleaseSize = 337 // CryptocurrencyPurchasePaymentAddressMaxLength - max permissible length for an address CryptocurrencyPurchasePaymentAddressMaxLength = 512 )
const ( // PostStatusMaxCharacters - Maximum length of the status field of a post PostStatusMaxCharacters = 280 // PostLongFormMaxCharacters - Maximum length of the longForm field of a post PostLongFormMaxCharacters = 50000 // PostMaximumTotalTags - Maximum number of tags a post can have PostMaximumTotalTags = 50 // PostMaximumTotalChannels - Maximum number of channels a post can be addressed to PostMaximumTotalChannels = 30 // PostTagsMaxCharacters - Maximum character length of a tag PostTagsMaxCharacters = 256 // PostChannelsMaxCharacters - Maximum character length of a channel PostChannelsMaxCharacters = 256 // PostReferenceMaxCharacters - Maximum character length of a reference PostReferenceMaxCharacters = 256 )
Constants for validation
const ConfirmationsPerHour = 6
ConfirmationsPerHour is temporary until the Wallet interface has Attributes() to provide this value
const DefaultCurrencyDivisibility uint32 = 1e8
DefaultCurrencyDivisibility is the Divisibility of the Currency if not defined otherwise
const KeyCachePrefix = "/pubkey/"
KeyCachePrefix - cache prefix for public key
Variables ¶
var ( // EscrowTimeLockedError - custom err for time locked escrow EscrowTimeLockedError error // ErrPrematureReleaseOfTimedoutEscrowFunds - custom err for premature escrow funds release ErrPrematureReleaseOfTimedoutEscrowFunds = fmt.Errorf("escrow can only be released when in dispute for %s days", (time.Duration(repo.DisputeTotalDurationHours) * time.Hour).String()) )
var ( // ErrPurchaseUnknownListing - unavailable listing err ErrPurchaseUnknownListing = errors.New("order contains a hash of a listing that is not currently for sale") // ErrListingDoesNotExist - non-existent listing err ErrListingDoesNotExist = errors.New("listing doesn't exist") // ErrListingAlreadyExists - duplicate listing err ErrListingAlreadyExists = errors.New("listing already exists") // ErrListingCoinDivisibilityIncorrect - coin divisibility err ErrListingCoinDivisibilityIncorrect = errors.New("incorrect coinDivisibility") // ErrPriceCalculationRequiresExchangeRates - exchange rates dependency err ErrPriceCalculationRequiresExchangeRates = errors.New("can't calculate price with exchange rates disabled") // ErrCryptocurrencyListingCoinTypeRequired - missing coinType err ErrCryptocurrencyListingCoinTypeRequired = errors.New("cryptocurrency listings require a coinType") // ErrCryptocurrencyPurchasePaymentAddressRequired - missing payment address err ErrCryptocurrencyPurchasePaymentAddressRequired = errors.New("paymentAddress required for cryptocurrency items") // ErrCryptocurrencyPurchasePaymentAddressTooLong - invalid payment address ErrCryptocurrencyPurchasePaymentAddressTooLong = errors.New("paymentAddress required is too long") // ErrCryptocurrencySkuQuantityInvalid - invalid sku qty err ErrCryptocurrencySkuQuantityInvalid = errors.New("cryptocurrency listing quantity must be a non-negative integer") // ErrFulfillIncorrectDeliveryType - incorrect delivery type err ErrFulfillIncorrectDeliveryType = errors.New("incorrect delivery type for order") // ErrFulfillCryptocurrencyTXIDNotFound - missing txn id err ErrFulfillCryptocurrencyTXIDNotFound = errors.New("a transactionID is required to fulfill crypto listings") // ErrFulfillCryptocurrencyTXIDTooLong - invalid txn id err ErrFulfillCryptocurrencyTXIDTooLong = errors.New("transactionID should be no longer than " + strconv.Itoa(MaxTXIDSize)) // ErrUnknownWallet is returned when a wallet is not present on the node ErrUnknownWallet = errors.New("Unknown wallet type") // ErrInvalidSpendAddress is returned when the wallet is unable to decode the string address into a valid destination to send funds to ErrInvalidSpendAddress = errors.New("ERROR_INVALID_ADDRESS") // ErrInsufficientFunds is returned when the wallet is unable to send the amount specified due to the balance being too low ErrInsufficientFunds = errors.New("ERROR_INSUFFICIENT_FUNDS") // ErrSpendAmountIsDust is returned when the requested amount to spend out of the wallet would be considered "dust" by the network. This means the value is too low for the network to bother sending the amount and has a high likelihood of not being accepted or being outright rejected. ErrSpendAmountIsDust = errors.New("ERROR_DUST_AMOUNT") // ErrUnknownOrder is returned when the requested amount to spend is unable to be associated with the appropriate order ErrOrderNotFound = errors.New("ERROR_ORDER_NOT_FOUND") )
var ( ErrShippingRegionMustBeSet = errors.New("shipping region must be set") ErrShippingRegionUndefined = errors.New("undefined shipping region") ErrShippingRegionMustNotBeContinent = errors.New("cannot specify continent as shipping region") )
var ( // ErrPostUnknownValidationPanic - post has an unknown panic error ErrPostUnknownValidationPanic = errors.New("unexpected validation panic") // ErrPostSlugNotEmpty - post slug is empty error ErrPostSlugNotEmpty = errors.New("slug must not be empty") // ErrPostSlugTooLong - post slug longer than max characters error ErrPostSlugTooLong = fmt.Errorf("slug is longer than the max of %d", SentenceMaxCharacters) // ErrPostSlugContainsSpaces - post slug has spaces error ErrPostSlugContainsSpaces = errors.New("slugs cannot contain spaces") // ErrPostSlugContainsSlashes - post slug has file separators ErrPostSlugContainsSlashes = errors.New("slugs cannot contain file separators") // ErrPostInvalidType - post type is invalid error ErrPostInvalidType = errors.New("invalid post type") // ErrPostStatusTooLong - post 'status' is longer than max characters error ErrPostStatusTooLong = fmt.Errorf("status is longer than the max of %d", PostStatusMaxCharacters) // ErrPostBodyTooLong - post 'longForm' is longer than max characters error ErrPostBodyTooLong = fmt.Errorf("post is longer than the max of %d characters", PostLongFormMaxCharacters) // ErrPostTagsTooMany - post tags longer than max length error ErrPostTagsTooMany = fmt.Errorf("tags in the post is longer than the max of %d", PostMaximumTotalTags) // ErrPostTagsEmpty - post has empty tags error ErrPostTagsEmpty = errors.New("tags must not be empty") // ErrPostTagTooLong - post tag has characters longer than max length error ErrPostTagTooLong = fmt.Errorf("tags must be less than max of %d characters", PostTagsMaxCharacters) // ErrPostChannelsTooMany - post channels longer than max length error ErrPostChannelsTooMany = fmt.Errorf("channels in the post is longer than the max of %d", PostMaximumTotalChannels) // ErrPostChannelTooLong - post channel has characters longer than max length error ErrPostChannelTooLong = fmt.Errorf("channels must be less than max of %d characters", PostChannelsMaxCharacters) // ErrPostReferenceEmpty - post has an empty reference error ErrPostReferenceEmpty = errors.New("reference must not be empty") // ErrPostReferenceTooLong - post reference has characters longer than max length error ErrPostReferenceTooLong = fmt.Errorf("reference is longer than the max of %d", PostReferenceMaxCharacters) // ErrPostReferenceContainsSpaces - post reference has spaces error ErrPostReferenceContainsSpaces = errors.New("reference cannot contain spaces") // ErrPostImagesTooMany - post images longer than max error ErrPostImagesTooMany = fmt.Errorf("number of post images is greater than the max of %d", MaxListItems) // ErrPostImageTinyFormatInvalid - post tiny image hash incorrectly formatted error ErrPostImageTinyFormatInvalid = errors.New("tiny image hashes must be properly formatted CID") // ErrPostImageSmallFormatInvalid - post small image hash incorrectly formatted error ErrPostImageSmallFormatInvalid = errors.New("small image hashes must be properly formatted CID") // ErrPostImageMediumFormatInvalid - post medium image hash incorrectly formatted error ErrPostImageMediumFormatInvalid = errors.New("medium image hashes must be properly formatted CID") // ErrPostImageLargeFInvalidormat - post large image hash incorrectly formatted error ErrPostImageLargeFormatInvalid = errors.New("large image hashes must be properly formatted CID") // ErrPostImageOriginalFormatInvalid - post original image hash incorrectly formatted error ErrPostImageOriginalFormatInvalid = errors.New("original image hashes must be properly formatted CID") // ErrPostImageFilenameNil - post image filename is nil error ErrPostImageFilenameNil = errors.New("image file names must not be nil") // ErrPostImageFilenameTooLong - post image filename length longer than max ErrPostImageFilenameTooLong = fmt.Errorf("image filename length must be less than the max of %d", FilenameMaxCharacters) )
Errors
var DisputeWg = new(sync.WaitGroup)
DisputeWg - waitgroup for disputes
var ErrCaseNotFound = errors.New("case not found")
ErrCaseNotFound - case not found err
var ErrCloseFailureCaseExpired = errors.New("unable to close expired case")
ErrCloseFailureCaseExpired - tried closing expired case err
var ErrCloseFailureNoOutpoints = errors.New("unable to close case with missing outpoints")
ErrCloseFailureNoOutpoints indicates when a dispute cannot be closed due to neither party including outpoints with their dispute
var ( // ErrInventoryNotFoundForSlug - inventory not found error ErrInventoryNotFoundForSlug = errors.New("Could not find slug in inventory") )
var ErrNoListings = errors.New("no listings to set moderators on")
ErrNoListings - no listing error FIXME : This is not used anywhere
var ErrOpenFailureOrderExpired = errors.New("unable to open case because order is too old to dispute")
ErrOpenFailureOrderExpired - tried disputing expired order err
var ErrorProfileNotFound = errors.New("profile not found")
ErrorProfileNotFound - profile not found error
var InitalPublishComplete bool // = false
InitalPublishComplete - indicate publish completion
var (
// MaxTXIDSize - max length for order txnID
MaxTXIDSize = 512
)
var ModeratorPointerID multihash.Multihash
ModeratorPointerID moderator ipfs multihash
var OfflineMessageWaitGroup sync.WaitGroup
OfflineMessageWaitGroup - used for offline msgs
var PublishLock sync.Mutex
PublishLock seedLock - Unpin the current node repo, re-add it, then publish to IPNS
Functions ¶
func CheckAndSetUlimit ¶
func CheckAndSetUlimit() error
CheckAndSetUlimit raises the file descriptor limit
func EncodeMultihash ¶
EncodeMultihash - sha256 encode
func ExtractIDFromPointer ¶
ExtractIDFromPointer Certain pointers, such as moderators, contain a peerID. This function will extract the ID from the underlying PeerInfo object.
func FormatRFC3339PB ¶
func FormatRFC3339PB(ts google_protobuf.Timestamp) string
FormatRFC3339PB returns the given `google_protobuf.Timestamp` as a RFC3339 formatted string
func GetOrderQuantity ¶
func GetOrderQuantity(l *pb.Listing, item *pb.Order_Item) uint64
GetOrderQuantity - return the specified item quantity
func GetSelectedSku ¶
GetSelectedSku - return the specified item SKU
func NormalizeCurrencyCode ¶
NormalizeCurrencyCode standardizes the format for the given currency code
func ParseContractForListing ¶
ParseContractForListing - return the listing identified by the hash from the contract
func SameSku ¶
func SameSku(selectedVariants []int, sku *pb.Listing_Item_Sku) bool
SameSku - check if the variants have the same SKU
func ValidShippingRegion ¶
func ValidShippingRegion(shippingOption *pb.Listing_ShippingOption) error
func ValidateProfile ¶
ValidateProfile - validate fetched profile
Types ¶
type CodedError ¶
type CodedError struct { Reason string `json:"reason,omitempty"` Code string `json:"code,omitempty"` }
CodedError is an error that is machine readable
func (CodedError) Error ¶
func (err CodedError) Error() string
type ErrCryptocurrencyListingIllegalField ¶
type ErrCryptocurrencyListingIllegalField string
ErrCryptocurrencyListingIllegalField - invalid field err
func (ErrCryptocurrencyListingIllegalField) Error ¶
func (e ErrCryptocurrencyListingIllegalField) Error() string
type ErrCryptocurrencyPurchaseIllegalField ¶
type ErrCryptocurrencyPurchaseIllegalField string
ErrCryptocurrencyPurchaseIllegalField - invalid purchase field err
func (ErrCryptocurrencyPurchaseIllegalField) Error ¶
func (e ErrCryptocurrencyPurchaseIllegalField) Error() string
type ErrMarketPriceListingIllegalField ¶
type ErrMarketPriceListingIllegalField string
ErrMarketPriceListingIllegalField - invalid listing field err
func (ErrMarketPriceListingIllegalField) Error ¶
func (e ErrMarketPriceListingIllegalField) Error() string
type ErrOutOfInventory ¶
type ErrOutOfInventory struct { CodedError RemainingInventory int64 `json:"remainingInventory"` }
ErrOutOfInventory is a codedError returned from vendor nodes when buyers try purchasing too many of an item
func NewErrOutOfInventory ¶
func NewErrOutOfInventory(inventoryRemaining int64) ErrOutOfInventory
NewErrOutOfInventory - return out of inventory err with available inventory
func (ErrOutOfInventory) Error ¶
func (err ErrOutOfInventory) Error() string
type ErrPriceModifierOutOfRange ¶
ErrPriceModifierOutOfRange - customize limits for price modifier
func (ErrPriceModifierOutOfRange) Error ¶
func (e ErrPriceModifierOutOfRange) Error() string
type EvenNode ¶
type EvenNode struct { // IPFS node object IpfsNode *core.IpfsNode /* The roothash of the node directory inside the openbazaar repo. This directory hash is published on IPNS at our peer ID making the directory publicly viewable on the network. */ RootHash string // The path to the openbazaar repo in the file system RepoPath string // The EvenNetwork network service for direct communication between peers Service net.NetworkService // Database for storing node specific data Datastore repo.Datastore // Websocket channel used for pushing data to the UI Broadcast chan repo.Notifier // A map of cryptocurrency wallets Multiwallet multiwallet.MultiWallet // Storage for our outgoing messages MessageStorage sto.OfflineMessagingStorage // A service that periodically checks the dht for outstanding messages MessageRetriever *ret.MessageRetriever // OfflineMessageFailoverTimeout is the duration until the protocol // will stop looking for the peer to send a direct message and failover to // sending an offline message OfflineMessageFailoverTimeout time.Duration // A service that periodically republishes active pointers PointerRepublisher *rep.PointerRepublisher // Used to resolve domains to EvenNetwork IDs NameSystem *namesys.NameSystem // Optional nodes to push user data to PushNodes []peer.ID // The user-agent for this node UserAgent string // A dialer for Tor if available TorDialer proxy.Dialer // Manage blocked peers BanManager *net.BanManager // Allow other nodes to push data to this node for storage AcceptStoreRequests bool // Last ditch API to find records that dropped out of the DHT IPNSBackupAPI string // RecordAgingNotifier is a worker that walks the cases datastore to // notify the user as disputes age past certain thresholds RecordAgingNotifier *recordAgingNotifier // Generic pubsub interface Pubsub ipfs.Pubsub // The master private key derived from the mnemonic MasterPrivateKey *hdkeychain.ExtendedKey TestnetEnable bool RegressionTestEnable bool }
EvenNode - represent ob node which encapsulates ipfsnode, wallet etc
var Node *EvenNode
Node - ob node
func (*EvenNode) BuildTransactionRecords ¶
func (n *EvenNode) BuildTransactionRecords(contract *pb.RicardianContract, records []*wallet.TransactionRecord, state pb.OrderState) ([]*pb.TransactionRecord, *pb.TransactionRecord, error)
BuildTransactionRecords - Used by the GET order API to build transaction records suitable to be included in the order response
func (*EvenNode) CalcOrderID ¶
CalcOrderID - return b58 encoded orderID
func (*EvenNode) CalculateOrderTotal ¶
func (n *EvenNode) CalculateOrderTotal(contract *pb.RicardianContract) (uint64, error)
CalculateOrderTotal - calculate the total in satoshi/wei
func (*EvenNode) CancelOfflineOrder ¶
func (n *EvenNode) CancelOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
CancelOfflineOrder - cancel order
func (*EvenNode) CloseDispute ¶
func (n *EvenNode) CloseDispute(orderID string, buyerPercentage, vendorPercentage float32, resolution string, paymentCoinHint *repo.CurrencyCode) error
CloseDispute - close a dispute
func (*EvenNode) CompleteOrder ¶
func (n *EvenNode) CompleteOrder(orderRatings *OrderRatings, contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
CompleteOrder - complete the order
func (*EvenNode) ConfirmOfflineOrder ¶
func (n *EvenNode) ConfirmOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
ConfirmOfflineOrder - confirm offline order
func (*EvenNode) CreateListing ¶
CreateListing - add a listing
func (*EvenNode) DeleteListing ¶
DeleteListing Deletes the listing directory, removes the listing from the index, and deletes the inventory
func (*EvenNode) DeletePost ¶
DeletePost [Deletes the post directory, and removes the post from the index]
func (*EvenNode) DisputeIsActive ¶
func (n *EvenNode) DisputeIsActive(contract *pb.RicardianContract) (bool, error)
DisputeIsActive - check if the dispute is active
func (*EvenNode) EncryptMessage ¶
func (n *EvenNode) EncryptMessage(peerID peer.ID, peerKey *libp2p.PubKey, message []byte) (ct []byte, rerr error)
EncryptMessage This is a placeholder until the libsignal is operational.
For now we will just encrypt outgoing offline messages with the long lived identity key. Optionally you may provide a public key, to avoid doing an IPFS lookup
func (*EvenNode) EstimateOrderTotal ¶
func (n *EvenNode) EstimateOrderTotal(data *PurchaseData) (uint64, error)
EstimateOrderTotal - returns order total in satoshi/wei
func (*EvenNode) FetchAvatar ¶
FetchAvatar - fetch image avatar from ipfs
func (*EvenNode) FetchHeader ¶
FetchHeader - fetch image header from ipfs
func (*EvenNode) FetchImage ¶
func (n *EvenNode) FetchImage(peerID string, imageType string, size string, useCache bool) (io.DagReader, error)
FetchImage - fetch ipfs image
func (*EvenNode) FetchProfile ¶
FetchProfile - fetch peer's profile
func (*EvenNode) FulfillOrder ¶
func (n *EvenNode) FulfillOrder(fulfillment *pb.OrderFulfillment, contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
FulfillOrder - fulfill the order
func (*EvenNode) GeneratePostSlug ¶
GeneratePostSlug [Create a slug for the post based on the status, if a slug is missing]
func (*EvenNode) GenerateSlug ¶
GenerateSlug - slugify the title of the listing
func (*EvenNode) GetBase64Image ¶
GetBase64Image - fetch the image and return it as base64 encoded string
func (*EvenNode) GetListingCount ¶
GetListingCount Return the current number of listings
func (*EvenNode) GetListingFromHash ¶
func (n *EvenNode) GetListingFromHash(hash string) (*pb.SignedListing, error)
GetListingFromHash - fetch listing for the specified hash
func (*EvenNode) GetListingFromSlug ¶
func (n *EvenNode) GetListingFromSlug(slug string) (*pb.SignedListing, error)
GetListingFromSlug - fetch listing for the specified slug
func (*EvenNode) GetListings ¶
GetListings - fetch all listings
func (*EvenNode) GetLocalInventory ¶
GetLocalInventory gets the inventory from the database
func (*EvenNode) GetLocalInventoryForSlug ¶
func (n *EvenNode) GetLocalInventoryForSlug(slug string) (*InventoryListing, error)
GetLocalInventoryForSlug gets the local inventory for the given slug
func (*EvenNode) GetModeratorFee ¶
func (n *EvenNode) GetModeratorFee(transactionTotal uint64, paymentCoin, currencyCode string) (uint64, error)
GetModeratorFee - fetch moderator fee
func (*EvenNode) GetPeerStatus ¶
GetPeerStatus - check if a peer is online/offline
func (*EvenNode) GetPostCount ¶
GetPostCount [Return the current number of posts]
func (*EvenNode) GetPostFromHash ¶
func (n *EvenNode) GetPostFromHash(hash string) (*pb.SignedPost, error)
GetPostFromHash [Get a post based on the hash]
func (*EvenNode) GetPostFromSlug ¶
func (n *EvenNode) GetPostFromSlug(slug string) (*pb.SignedPost, error)
GetPostFromSlug [Get a post based on the slug]
func (*EvenNode) GetProfile ¶
GetProfile - fetch user profile
func (*EvenNode) GetPublishedInventoryBytes ¶
GetPublishedInventoryBytes gets a byte slice representing the given peer's inventory that it published to IPFS
func (*EvenNode) GetPublishedInventoryBytesForSlug ¶
func (n *EvenNode) GetPublishedInventoryBytesForSlug(p peer.ID, slug string, useCache bool) ([]byte, error)
GetPublishedInventoryBytesForSlug gets a byte slice representing the given slug's inventory from IPFS
func (*EvenNode) GetRatingCounts ¶
GetRatingCounts - fetch rating count
func (*EvenNode) IPFSIdentityString ¶
IPFSIdentityString - IPFS identifier
func (*EvenNode) IPNSResolve ¶
IPNSResolve - try fetching the record from an API
func (*EvenNode) IPNSResolveThenCat ¶
func (n *EvenNode) IPNSResolveThenCat(ipnsPath ipfspath.Path, timeout time.Duration, usecache bool) ([]byte, error)
IPNSResolveThenCat - find the record in the DHT
func (*EvenNode) ImportListings ¶
func (n *EvenNode) ImportListings(r io.ReadCloser) error
ImportListings - upload/read listings
func (*EvenNode) IsFulfilled ¶
func (n *EvenNode) IsFulfilled(contract *pb.RicardianContract) bool
IsFulfilled - check is order is fulfilled
func (*EvenNode) IsItemForSale ¶
IsItemForSale Check to see we are selling the given listing. Used when validating an order. FIXME: This won't scale well. We will need to store the hash of active listings in a db to do an indexed search.
func (*EvenNode) IsModerator ¶
IsModerator - Am I a moderator?
func (*EvenNode) NewOrderConfirmation ¶
func (n *EvenNode) NewOrderConfirmation(contract *pb.RicardianContract, addressRequest, calculateNewTotal bool) (*pb.RicardianContract, error)
NewOrderConfirmation - add order confirmation to the contract
func (*EvenNode) NotifyModerators ¶
NotifyModerators - notify moderators(peers)
func (*EvenNode) OpenDispute ¶
func (n *EvenNode) OpenDispute(orderID string, contract *pb.RicardianContract, records []*wallet.TransactionRecord, claim string) error
OpenDispute - open a dispute
func (*EvenNode) PatchProfile ¶
PatchProfile - patch user profile
func (*EvenNode) ProcessDisputeOpen ¶
func (n *EvenNode) ProcessDisputeOpen(rc *pb.RicardianContract, peerID string) error
ProcessDisputeOpen - process an open dispute
func (*EvenNode) PublishInventory ¶
PublishInventory stores an inventory on IPFS
func (*EvenNode) Purchase ¶
func (n *EvenNode) Purchase(data *PurchaseData) (orderID string, paymentAddress string, paymentAmount uint64, vendorOnline bool, err error)
Purchase - add ricardian contract
func (*EvenNode) RefundOrder ¶
func (n *EvenNode) RefundOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
RefundOrder - refund buyer
func (*EvenNode) RegressionNetworkEnabled ¶
RegressionNetworkEnabled indicates whether the node is operating with regression parameters
func (*EvenNode) RejectOfflineOrder ¶
func (n *EvenNode) RejectOfflineOrder(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
RejectOfflineOrder - reject offline order
func (*EvenNode) ReleaseFunds ¶
func (n *EvenNode) ReleaseFunds(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
ReleaseFunds - release funds
func (*EvenNode) ReleaseFundsAfterTimeout ¶
func (n *EvenNode) ReleaseFundsAfterTimeout(contract *pb.RicardianContract, records []*wallet.TransactionRecord) error
ReleaseFundsAfterTimeout - release funds
func (*EvenNode) RemoveSelfAsModerator ¶
RemoveSelfAsModerator - relinquish moderatorship
func (*EvenNode) SendCancel ¶
SendCancel - send order canceled msg to peer
func (*EvenNode) SendDisputeClose ¶
func (n *EvenNode) SendDisputeClose(peerID string, k *libp2p.PubKey, resolutionMessage *pb.RicardianContract) error
SendDisputeClose - send dispute closed msg to peer
func (*EvenNode) SendDisputeOpen ¶
func (n *EvenNode) SendDisputeOpen(peerID string, k *libp2p.PubKey, disputeMessage *pb.RicardianContract) error
SendDisputeOpen - send open dispute msg to peer
func (*EvenNode) SendDisputeUpdate ¶
func (n *EvenNode) SendDisputeUpdate(peerID string, updateMessage *pb.DisputeUpdate) error
SendDisputeUpdate - send update dispute msg to peer
func (*EvenNode) SendFundsReleasedByVendor ¶
func (n *EvenNode) SendFundsReleasedByVendor(peerID string, marshalledPeerPublicKey []byte, orderID string) error
SendFundsReleasedByVendor - send funds released by vendor msg to peer
func (*EvenNode) SendModeratorAdd ¶
SendModeratorAdd - send add moderator msg to peer
func (*EvenNode) SendModeratorRemove ¶
SendModeratorRemove - send remove moderator msg to peer
func (*EvenNode) SendOfflineAck ¶
SendOfflineAck - send ack to offline peer
func (*EvenNode) SendOfflineMessage ¶
SendOfflineMessage Supply of a public key is optional, if nil is instead provided n.EncryptMessage does a lookup
func (*EvenNode) SendOfflineRelay ¶
SendOfflineRelay - send and offline relay message to the peer. Used for relaying messages from a client node to another peer.
func (*EvenNode) SendOrder ¶
func (n *EvenNode) SendOrder(peerID string, contract *pb.RicardianContract) (resp *pb.Message, err error)
SendOrder - send order created msg to peer
func (*EvenNode) SendOrderCompletion ¶
func (n *EvenNode) SendOrderCompletion(peerID string, k *libp2p.PubKey, completionMessage *pb.RicardianContract) error
SendOrderCompletion - send order completion msg to peer
func (*EvenNode) SendOrderConfirmation ¶
func (n *EvenNode) SendOrderConfirmation(peerID string, contract *pb.RicardianContract) error
SendOrderConfirmation - send order confirmed msg to peer
func (*EvenNode) SendOrderFulfillment ¶
func (n *EvenNode) SendOrderFulfillment(peerID string, k *libp2p.PubKey, fulfillmentMessage *pb.RicardianContract) error
SendOrderFulfillment - send order fulfillment msg to peer
func (*EvenNode) SendRefund ¶
func (n *EvenNode) SendRefund(peerID string, refundMessage *pb.RicardianContract) error
SendRefund - send refund msg to peer
func (*EvenNode) SendReject ¶
func (n *EvenNode) SendReject(peerID string, rejectMessage *pb.OrderReject) error
SendReject - send order rejected msg to peer
func (*EvenNode) SetAvatarImages ¶
func (n *EvenNode) SetAvatarImages(base64ImageData string) (*pb.Profile_Image, error)
SetAvatarImages - set avatar image from the base64 encoded image string
func (*EvenNode) SetHeaderImages ¶
func (n *EvenNode) SetHeaderImages(base64ImageData string) (*pb.Profile_Image, error)
SetHeaderImages - set header image from the base64 encoded string
func (*EvenNode) SetListingInventory ¶
SetListingInventory Sets the inventory for the listing in the database. Does some basic validation
to make sure the inventory uses the correct variants.
func (*EvenNode) SetModeratorsOnListings ¶
SetModeratorsOnListings - set moderators for a listing
func (*EvenNode) SetProductImages ¶
func (n *EvenNode) SetProductImages(base64ImageData, filename string) (*pb.Profile_Image, error)
SetProductImages - use the original image ina base64 string format and generate tiny, small, medium and large images for the product
func (*EvenNode) SetSelfAsModerator ¶
SetSelfAsModerator - set self as a moderator
func (*EvenNode) SetUpRepublisher ¶
SetUpRepublisher - periodic publishing to IPNS
func (*EvenNode) SignDispute ¶
func (n *EvenNode) SignDispute(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignDispute - sign the dispute
func (*EvenNode) SignDisputeResolution ¶
func (n *EvenNode) SignDisputeResolution(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignDisputeResolution - add signature to DisputeResolution
func (*EvenNode) SignListing ¶
SignListing Add our identity to the listing and sign it
func (*EvenNode) SignOrder ¶
func (n *EvenNode) SignOrder(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignOrder - add signature to the order
func (*EvenNode) SignOrderCompletion ¶
func (n *EvenNode) SignOrderCompletion(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignOrderCompletion - sign order on completion
func (*EvenNode) SignOrderConfirmation ¶
func (n *EvenNode) SignOrderConfirmation(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignOrderConfirmation - sign the added order confirmation
func (*EvenNode) SignOrderFulfillment ¶
func (n *EvenNode) SignOrderFulfillment(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignOrderFulfillment - add signature to order fulfillment
func (*EvenNode) SignRefund ¶
func (n *EvenNode) SignRefund(contract *pb.RicardianContract) (*pb.RicardianContract, error)
SignRefund - add signature to refund
func (*EvenNode) Spend ¶
func (n *EvenNode) Spend(args *SpendRequest) (*SpendResponse, error)
Spend will attempt to move funds from the node to the destination address described in the SpendRequest for the amount indicated.
func (*EvenNode) StartMessageRetriever ¶
func (n *EvenNode) StartMessageRetriever()
StartMessageRetriever will collect the required options from the EvenNode and begin the MessageRetriever in the background
func (*EvenNode) StartPointerRepublisher ¶
func (n *EvenNode) StartPointerRepublisher()
StartPointerRepublisher - setup republisher for IPNS
func (*EvenNode) StartRecordAgingNotifier ¶
func (n *EvenNode) StartRecordAgingNotifier()
StartRecordAgingNotifier - start the notifier
func (*EvenNode) TestNetworkEnabled ¶
TestNetworkEnabled indicates whether the node is operating with test parameters
func (*EvenNode) UpdateEachListingOnIndex ¶
func (n *EvenNode) UpdateEachListingOnIndex(updateListing func(*ListingData) error) error
UpdateEachListingOnIndex will visit each listing in the index and execute the function with a pointer to the listing passed as the argument. The function should return an error to further processing.
func (*EvenNode) UpdateFollow ¶
UpdateFollow This function updates the follow and following lists in the node's root directory
as well as adds the current follow, following, and listing counts to the profile. We only do this when a user updates his node to avoid needing to make network calls each time a new follower or unfollow request comes in.
func (*EvenNode) UpdateListing ¶
UpdateListing - update the listing
func (*EvenNode) UpdatePostHashes ¶
UpdatePostHashes [Update the hashes in the posts.json file]
func (*EvenNode) UpdatePostIndex ¶
func (n *EvenNode) UpdatePostIndex(post *pb.SignedPost) error
UpdatePostIndex [Update the posts index]
func (*EvenNode) UpdateProfile ¶
UpdateProfile - update user profile
func (*EvenNode) ValidateAndSaveRating ¶
func (n *EvenNode) ValidateAndSaveRating(contract *pb.RicardianContract) (retErr error)
ValidateAndSaveRating - validates rating
func (*EvenNode) ValidateCaseContract ¶
func (n *EvenNode) ValidateCaseContract(contract *pb.RicardianContract) []string
ValidateCaseContract - validate contract details
func (*EvenNode) ValidateDirectPaymentAddress ¶
ValidateDirectPaymentAddress - validate address
func (*EvenNode) ValidateDisputeResolution ¶
func (n *EvenNode) ValidateDisputeResolution(contract *pb.RicardianContract) error
ValidateDisputeResolution - validate dispute resolution
func (*EvenNode) ValidateModeratedPaymentAddress ¶
ValidateModeratedPaymentAddress - validate moderator address
func (*EvenNode) ValidateMultiwalletHasPreferredCurrencies ¶
func (n *EvenNode) ValidateMultiwalletHasPreferredCurrencies(data repo.SettingsData) error
func (*EvenNode) ValidateOrder ¶
func (n *EvenNode) ValidateOrder(contract *pb.RicardianContract, checkInventory bool) error
ValidateOrder - check the order validity wrt signatures etc
func (*EvenNode) ValidateOrderCompletion ¶
func (n *EvenNode) ValidateOrderCompletion(contract *pb.RicardianContract) error
ValidateOrderCompletion - validate order signatures on completion
func (*EvenNode) ValidateOrderConfirmation ¶
func (n *EvenNode) ValidateOrderConfirmation(contract *pb.RicardianContract, validateAddress bool) error
ValidateOrderConfirmation - validate address and signatures for order confirmation
func (*EvenNode) ValidateOrderFulfillment ¶
func (n *EvenNode) ValidateOrderFulfillment(fulfillment *pb.OrderFulfillment, contract *pb.RicardianContract) error
ValidateOrderFulfillment - validate order details
func (*EvenNode) ValidatePaymentAmount ¶
ValidatePaymentAmount - validate amount requested
func (*EvenNode) VerifySignatureOnDisputeOpen ¶
func (n *EvenNode) VerifySignatureOnDisputeOpen(contract *pb.RicardianContract, peerID string) error
VerifySignatureOnDisputeOpen - verify signatures in an open dispute
func (*EvenNode) VerifySignaturesOnRefund ¶
func (n *EvenNode) VerifySignaturesOnRefund(contract *pb.RicardianContract) error
VerifySignaturesOnRefund - verify signatures on refund
func (*EvenNode) WaitForMessageRetrieverCompletion ¶
func (n *EvenNode) WaitForMessageRetrieverCompletion()
WaitForMessageRetrieverCompletion will return once the MessageRetriever has finished processing messages
type Inventory ¶
type Inventory map[string]*InventoryListing
Inventory is the complete inventory representation stored on IPFS It maps slug -> quantity information
type InventoryListing ¶
type InventoryListing struct { Inventory int64 `json:"inventory"` LastUpdated string `json:"lastUpdated"` }
InventoryListing is the listing representation stored on IPFS
type ListingData ¶
type ListingData struct { Hash string `json:"hash"` Slug string `json:"slug"` Title string `json:"title"` Categories []string `json:"categories"` NSFW bool `json:"nsfw"` ContractType string `json:"contractType"` Description string `json:"description"` Thumbnail thumbnail `json:"thumbnail"` Price price `json:"price"` ShipsTo []string `json:"shipsTo"` FreeShipping []string `json:"freeShipping"` Language string `json:"language"` AverageRating float32 `json:"averageRating"` RatingCount uint32 `json:"ratingCount"` ModeratorIDs []string `json:"moderators"` AcceptedCurrencies []string `json:"acceptedCurrencies"` CoinType string `json:"coinType"` }
ListingData - represent a listing
type OrderRatings ¶
type OrderRatings struct { OrderID string `json:"orderId"` Ratings []RatingData `json:"ratings"` }
OrderRatings - record ratings for an order
type PurchaseData ¶
type PurchaseData struct { ShipTo string `json:"shipTo"` Address string `json:"address"` City string `json:"city"` State string `json:"state"` PostalCode string `json:"postalCode"` CountryCode string `json:"countryCode"` AddressNotes string `json:"addressNotes"` Moderator string `json:"moderator"` Items []item `json:"items"` AlternateContactInfo string `json:"alternateContactInfo"` RefundAddress *string `json:"refundAddress"` //optional, can be left out of json PaymentCoin string `json:"paymentCoin"` }
PurchaseData - record purchase data
type RatingData ¶
type RatingData struct { Slug string `json:"slug"` Overall int `json:"overall"` Quality int `json:"quality"` Description int `json:"description"` DeliverySpeed int `json:"deliverySpeed"` CustomerService int `json:"customerService"` Review string `json:"review"` Anonymous bool `json:"anonymous"` }
RatingData - record rating in detail
type SavedRating ¶
type SavedRating struct { Slug string `json:"slug"` Count int `json:"count"` Average float32 `json:"average"` Ratings []string `json:"ratings"` }
SavedRating - represent saved rating
type SpendRequest ¶
type SpendRequest struct { Address string `json:"address"` Amount int64 `json:"amount"` FeeLevel string `json:"feeLevel"` Memo string `json:"memo"` OrderID string `json:"orderId"` RequireAssociatedOrder bool `json:"requireOrder"` Wallet string `json:"wallet"` // contains filtered or unexported fields }
type SpendResponse ¶
Source Files
¶
- completion.go
- confirmation.go
- core.go
- disputes.go
- errors.go
- follow.go
- fulfillment.go
- images.go
- import.go
- inventory.go
- ipns.go
- listings.go
- message_retriever.go
- moderation.go
- net.go
- order.go
- pointer_republisher.go
- posts.go
- profile.go
- ratings.go
- record_aging_notifier.go
- refunds.go
- signatures.go
- spend.go
- ulimit_unix.go
- utils.go