Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBitsuranceId ¶
GetBitsuranceId returns the BitsuranceId of a given account. The id is computed hashing with sha256 the P2WPKH xpub of the account, concatenated with a fixed salt. If a P2WPKH xpub can't be found in the account, empty string is returned.
Types ¶
type AccountDetails ¶
type AccountDetails struct { AccountCode types.Code `json:"code"` Status DetailStatus `json:"status"` Details struct { MaxCoverage int `json:"maxCoverage"` MaxCoverageFormatted string `json:"maxCoverageFormatted"` Currency string `json:"currency"` // Support contains a link to the bitsurance support page relevant for the account Support string `json:"support"` } `json:"details"` }
AccountDetails represents the response of the bitsurance server for a single account.
func LookupBitsuranceAccounts ¶
func LookupBitsuranceAccounts(devServer bool, accounts []accounts.Interface, httpClient *http.Client) ([]AccountDetails, error)
LookupBitsuranceAccounts takes in input a slice of accounts. For each account, it interrogates the Bitsurance server and returns a map with the given accounts' codes as keys and the insurance details as value.
type DetailStatus ¶
type DetailStatus string
DetailStatus is the status of the insurance contract. Possible values (from Bitsurance Api docs) are listed below.
const ( // ActiveStatus - insurance coverage activated. ActiveStatus DetailStatus = "active" // ProcessingStatus - when still in creation/checking phase (short time). ProcessingStatus DetailStatus = "processing" // RefusedStatus - application got refused. RefusedStatus DetailStatus = "refused" // WaitPaymentStatus - accepted, but waiting on first payment. WaitPaymentStatus DetailStatus = "waitpayment" // InactiveStatus - offer support link for more info (maybe missed payment). InactiveStatus DetailStatus = "inactive" // CanceledStatus - contract got canceled. CanceledStatus DetailStatus = "canceled" )
Click to show internal directories.
Click to hide internal directories.