Skip to content

Latest commit

 

History

History
336 lines (232 loc) · 5.59 KB

on-chain.md

File metadata and controls

336 lines (232 loc) · 5.59 KB

GetOnChainClient

Definition:

func GetOnChainClient(mcsClient user.McsClient) *OnChainClient

Outputs:

*OnChainClient  # includes jwt token and other information for use when call the other apis

GetSystemParam

Definition:

func (onChainClient *OnChainClient) GetSystemParam() (*SystemParam, error)

Outputs:

*SystemParam  # system parameters
error         # error or nil

GetHistoricalAveragePriceVerified

Definition:

func GetHistoricalAveragePriceVerified() (float64, error)

Outputs:

float64    # historical average verified price
error      # error or nil

GetAmount

Definition:

func GetAmount(fizeSizeByte int64, historicalAveragePriceVerified, fileCoinPrice float64, copyNumber int) (int64, error)

Outputs:

int64    # amount to pay
error    # error or nil

Upload

Definition:

func (onChainClient *OnChainClient) Upload(filePath string, fileType int) (*UploadFile, error)

Outputs:

*UploadFile # upload file information
error       # error or nil

GetMintInfo

Definition:

func (onChainClient *OnChainClient) GetMintInfo(sourceFileUploadId int64) ([]*SourceFileMintOut, error)

Outputs:

*SourceFileMintOut # file mint info
error              # error or nil

GetUserTaskDeals

Definition:

func (onChainClient *OnChainClient) GetUserTaskDeals(dealsParams DealsParams) ([]*Deal, *int64, error)

Outputs:

[]*Deal # deal list
*int64  # total count
error   # error or nil

GetDealDetail

Definition:

func (onChainClient *OnChainClient) GetDealDetail(sourceFileUploadId, dealId int64) (*SourceFileUploadDeal, []*DaoSignature, *int, error)

Outputs:

*SourceFileUploadDeal # deal list
[]*DaoSignature       # dao signature list
*int                  # dao threshold
error                 # error or nil

GetDealLogs

Definition:

func (onChainClient *OnChainClient) GetDealLogs(offlineDealId int64) ([]*OfflineDealLog, error)

Outputs:

[]*OfflineDealLog  # deal logs
error              # error or nil

GetSourceFileUpload

Definition:

func (onChainClient *OnChainClient) GetSourceFileUpload(sourceFileUploadId int64) (*SourceFileUpload, error)

Outputs:

*SourceFileUpload  # source file upload information
error              # error or nil

UnpinSourceFile

Definition:

func (onChainClient *OnChainClient) UnpinSourceFile(sourceFileUploadId int64) error

Outputs:

error              # error or nil

WriteNftCollection

Definition:

func (onChainClient *OnChainClient) WriteNftCollection(nftCollectionParams NftCollectionParams) error

Outputs:

error              # error or nil

GetNftCollections

Definition:

func (onChainClient *OnChainClient) GetNftCollections() ([]*NftCollection, error)

Outputs:

[]*NftCollection   # NFT collections
error              # error or nil

RecordMintInfo

Definition:

func (onChainClient *OnChainClient) RecordMintInfo(recordMintInfoParams *RecordMintInfoParams) (*SourceFileMint, error)

Outputs:

*SourceFileMint   # Mint info
error             # error or nil

Pay

Definition:

func (onChainClient *OnChainClient) Pay(sourceFileUploadId int64, privateKeyStr string, rpcUrl string) (*string, error)

Outputs:

*string   # payment transaction hash
error     # error or nil

GetPaymentInfo

Definition:

func (client *OnChainClient) GetPaymentInfo(fileUploadId int64) (*LockPaymentInfo, error)

Outputs:

*LockPaymentInfo # payment information
error            # error or nil

GetFileCoinPrice

Definition:

func (onChainClient *OnChainClient) GetFileCoinPrice() (*float64, error)

Outputs:

*float64 # filecoin price
error    # error or nil

GetBillingHistory

Definition:

func (onChainClient *OnChainClient) GetBillingHistory(billingHistoryParams BillingHistoryParams) ([]*BillingHistory, *int64, error)

Outputs:

[]*BillingHistory # billing list
*int64            # total record number
error             # error or nil

GetDeals2PreSign

Definition:

func (onChainClient *OnChainClient) GetDeals2PreSign() ([]*Deal2PreSign, error)

Outputs:

[]*Deal2PreSign # deals to pre sign
error           # error or nil

GetDeals2Sign

Definition:

func (onChainClient *OnChainClient) GetDeals2Sign() ([]*Deal2Sign, error)

Outputs:

[]*Deal2Sign # deals to sign
error           # error or nil

GetDeals2SignHash

Definition:

func (onChainClient *OnChainClient) GetDeals2SignHash() ([]*Deal2Sign, error)

Outputs:

[]*Deal2Sign # deals to sign hash
error        # error or nil