Documentation ¶
Index ¶
Constants ¶
View Source
const (
// AttrFundingLabel is the funding agreement label
AttrFundingLabel = "funding_agreement"
)
View Source
const (
// BootstrappedFundingService is the key for Funding service in Context.
BootstrappedFundingService = "Funding Service"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrapper ¶
type Bootstrapper struct{}
Bootstrapper implements Bootstrapper Interface
func (Bootstrapper) Bootstrap ¶
func (Bootstrapper) Bootstrap(ctx map[string]interface{}) (err error)
Bootstrap adds the funding API handler to the context.
type Data ¶
type Data struct { AgreementID string `json:"agreement_id,omitempty" attr:"bytes"` BorrowerID string `json:"borrower_id,omitempty" attr:"bytes"` FunderID string `json:"funder_id,omitempty" attr:"bytes"` Amount string `json:"amount,omitempty" attr:"decimal"` Apr string `json:"apr,omitempty" attr:"string"` Days string `json:"days,omitempty" attr:"integer"` Fee string `json:"fee,omitempty" attr:"decimal"` RepaymentDueDate string `json:"repayment_due_date,omitempty" attr:"timestamp"` RepaymentOccurredDate string `json:"repayment_occurred_date,omitempty" attr:"timestamp"` RepaymentAmount string `json:"repayment_amount,omitempty" attr:"decimal"` Currency string `json:"currency,omitempty" attr:"string"` NFTAddress string `json:"nft_address,omitempty" attr:"bytes"` PaymentDetailsID string `json:"payment_details_id,omitempty" attr:"bytes"` }
Data is the default funding extension schema.
type Service ¶
type Service interface { // Sign adds a signature to an existing document Sign(ctx context.Context, fundingID string, identifier []byte) (documents.Model, error) // CreateFundingAgreement creates a new funding agreement and anchors the document. CreateFundingAgreement(ctx context.Context, docID []byte, data *Data) (documents.Model, jobs.JobID, error) // UpdateFundingAgreement updates a given funding agreement with the data passed. UpdateFundingAgreement(ctx context.Context, docID, fundingID []byte, data *Data) (documents.Model, jobs.JobID, error) // GetDataAndSignatures return the funding Data and Signatures associated with the FundingID or funding index. GetDataAndSignatures(ctx context.Context, model documents.Model, fundingID string, idx string) (Data, []Signature, error) // SignFundingAgreement adds the signature to the given funding agreement. SignFundingAgreement(ctx context.Context, docID, fundingID []byte) (documents.Model, jobs.JobID, error) }
Service defines specific functions for extension funding
func DefaultService ¶
func DefaultService( srv documents.Service, tokenRegistry documents.TokenRegistry, ) Service
DefaultService returns the default implementation of the service.
Click to show internal directories.
Click to hide internal directories.