167 lines
6.5 KiB
Go
167 lines
6.5 KiB
Go
package main
|
|
|
|
import "time"
|
|
|
|
type marketplaceOffer struct {
|
|
OfferID string `json:"offer_id"`
|
|
IssuerID string `json:"issuer_id"`
|
|
Title string `json:"title"`
|
|
Summary string `json:"summary,omitempty"`
|
|
Status string `json:"status"`
|
|
Pricing marketplaceOfferPrice `json:"pricing"`
|
|
Policies marketplaceOfferPolicy `json:"policies"`
|
|
SortOrder int `json:"-"`
|
|
}
|
|
|
|
type marketplaceOfferPrice struct {
|
|
Currency string `json:"currency"`
|
|
AmountAtomic string `json:"amount_atomic"`
|
|
Decimals int `json:"decimals"`
|
|
ChainID int64 `json:"chain_id"`
|
|
}
|
|
|
|
type marketplaceOfferPolicy struct {
|
|
MemberOnly bool `json:"member_only"`
|
|
WorkspaceBound bool `json:"workspace_bound"`
|
|
Transferable bool `json:"transferable"`
|
|
InternalUseOnly bool `json:"internal_use_only"`
|
|
MultiTenant bool `json:"multi_tenant"`
|
|
EntitlementClass string `json:"entitlement_class,omitempty"`
|
|
RequiresOffers []string `json:"requires_offers,omitempty"`
|
|
}
|
|
|
|
type marketplaceOffersResponse struct {
|
|
Offers []marketplaceOffer `json:"offers"`
|
|
}
|
|
|
|
type marketplaceCheckoutQuoteRequest struct {
|
|
Wallet string `json:"wallet"`
|
|
PayerWallet string `json:"payer_wallet,omitempty"`
|
|
OfferID string `json:"offer_id"`
|
|
OrgRootID string `json:"org_root_id,omitempty"`
|
|
PrincipalID string `json:"principal_id,omitempty"`
|
|
PrincipalRole string `json:"principal_role,omitempty"`
|
|
WorkspaceID string `json:"workspace_id,omitempty"`
|
|
OwnershipProof string `json:"ownership_proof,omitempty"`
|
|
IncludeMembershipIfMissing *bool `json:"include_membership_if_missing,omitempty"`
|
|
}
|
|
|
|
type marketplaceQuoteLineItem struct {
|
|
Kind string `json:"kind"`
|
|
Label string `json:"label"`
|
|
Amount string `json:"amount"`
|
|
AmountAtomic string `json:"amount_atomic"`
|
|
Decimals int `json:"decimals"`
|
|
Currency string `json:"currency"`
|
|
}
|
|
|
|
type marketplaceCheckoutQuoteResponse struct {
|
|
QuoteID string `json:"quote_id"`
|
|
Wallet string `json:"wallet"`
|
|
PayerWallet string `json:"payer_wallet,omitempty"`
|
|
OfferID string `json:"offer_id"`
|
|
OrgRootID string `json:"org_root_id,omitempty"`
|
|
PrincipalID string `json:"principal_id,omitempty"`
|
|
PrincipalRole string `json:"principal_role,omitempty"`
|
|
Currency string `json:"currency"`
|
|
Amount string `json:"amount"`
|
|
AmountAtomic string `json:"amount_atomic"`
|
|
TotalAmount string `json:"total_amount"`
|
|
TotalAmountAtomic string `json:"total_amount_atomic"`
|
|
Decimals int `json:"decimals"`
|
|
MembershipActivationIncluded bool `json:"membership_activation_included"`
|
|
LineItems []marketplaceQuoteLineItem `json:"line_items"`
|
|
PolicyHash string `json:"policy_hash"`
|
|
ExpiresAt string `json:"expires_at"`
|
|
Tx map[string]any `json:"tx"`
|
|
AccessClass string `json:"access_class"`
|
|
AvailabilityState string `json:"availability_state"`
|
|
}
|
|
|
|
type marketplaceCheckoutConfirmRequest struct {
|
|
QuoteID string `json:"quote_id"`
|
|
Wallet string `json:"wallet"`
|
|
PayerWallet string `json:"payer_wallet,omitempty"`
|
|
OfferID string `json:"offer_id"`
|
|
OrgRootID string `json:"org_root_id,omitempty"`
|
|
PrincipalID string `json:"principal_id,omitempty"`
|
|
PrincipalRole string `json:"principal_role,omitempty"`
|
|
WorkspaceID string `json:"workspace_id,omitempty"`
|
|
TxHash string `json:"tx_hash"`
|
|
ChainID int64 `json:"chain_id"`
|
|
}
|
|
|
|
type marketplaceCheckoutConfirmResponse struct {
|
|
Status string `json:"status"`
|
|
EntitlementID string `json:"entitlement_id"`
|
|
OfferID string `json:"offer_id"`
|
|
OrgRootID string `json:"org_root_id,omitempty"`
|
|
PrincipalID string `json:"principal_id,omitempty"`
|
|
PrincipalRole string `json:"principal_role,omitempty"`
|
|
Wallet string `json:"wallet"`
|
|
TxHash string `json:"tx_hash"`
|
|
PolicyHash string `json:"policy_hash"`
|
|
ActivatedAt string `json:"activated_at"`
|
|
AccessClass string `json:"access_class"`
|
|
AvailabilityState string `json:"availability_state"`
|
|
}
|
|
|
|
type marketplaceEntitlement struct {
|
|
EntitlementID string `json:"entitlement_id"`
|
|
OfferID string `json:"offer_id"`
|
|
WalletAddress string `json:"wallet_address"`
|
|
WorkspaceID string `json:"workspace_id,omitempty"`
|
|
OrgRootID string `json:"org_root_id,omitempty"`
|
|
State string `json:"state"`
|
|
AccessClass string `json:"access_class"`
|
|
AvailabilityState string `json:"availability_state"`
|
|
PolicyHash string `json:"policy_hash"`
|
|
IssuedAt string `json:"issued_at"`
|
|
}
|
|
|
|
type marketplaceEntitlementsResponse struct {
|
|
Entitlements []marketplaceEntitlement `json:"entitlements"`
|
|
}
|
|
|
|
type marketplaceQuoteRecord struct {
|
|
QuoteID string
|
|
Wallet string
|
|
PayerWallet string
|
|
OfferID string
|
|
OrgRootID string
|
|
PrincipalID string
|
|
PrincipalRole string
|
|
WorkspaceID string
|
|
Currency string
|
|
AmountAtomic string
|
|
TotalAmountAtomic string
|
|
Decimals int
|
|
MembershipIncluded bool
|
|
LineItemsJSON string
|
|
PolicyHash string
|
|
AccessClass string
|
|
AvailabilityState string
|
|
CreatedAt time.Time
|
|
ExpiresAt time.Time
|
|
ConfirmedAt *time.Time
|
|
ConfirmedTxHash string
|
|
}
|
|
|
|
type marketplaceEntitlementRecord struct {
|
|
EntitlementID string
|
|
QuoteID string
|
|
OfferID string
|
|
Wallet string
|
|
PayerWallet string
|
|
OrgRootID string
|
|
PrincipalID string
|
|
PrincipalRole string
|
|
WorkspaceID string
|
|
State string
|
|
AccessClass string
|
|
AvailabilityState string
|
|
PolicyHash string
|
|
IssuedAt time.Time
|
|
TxHash string
|
|
}
|