거래

List all deals

List all deals

POST//localhost:9090/api/deal
Body

ListDealRequest

preparationsarray of string

preparation ID or name filter

providersarray of string

provider filter

schedulesarray of integer

schedule id filter

sourcesarray of string

source ID or name filter

statesarray of enum

state filter

Response

OK

Body
clientIdstring
createdAtstring
dealIdinteger
endEpochinteger
errorMessagestring
idinteger
labelstring
lastVerifiedAtstring

LastVerifiedAt is the last time the deal was verified as active by the tracker

pieceCidstring
pieceSizeinteger
pricestring
proposalIdstring
providerstring
scheduleIdinteger

Associations

sectorStartEpochinteger
startEpochinteger
stateenum
proposedpublishedactiveexpiredproposal_expiredrejectedslashederror
updatedAtstring
verifiedboolean
Request
const response = await fetch('//localhost:9090/api/deal', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "preparations": [
        null
      ],
      "providers": [
        null
      ],
      "schedules": [
        null
      ],
      "sources": [
        null
      ],
      "states": [
        "proposed"
      ]
    }),
});
const data = await response.json();
Response
[
  {
    "clientId": "text",
    "createdAt": "text",
    "dealId": 1,
    "endEpoch": 1,
    "errorMessage": "text",
    "id": 1,
    "label": "text",
    "lastVerifiedAt": "text",
    "pieceCid": "text",
    "pieceSize": 1,
    "price": "text",
    "proposalId": "text",
    "provider": "text",
    "scheduleId": 1,
    "sectorStartEpoch": 1,
    "startEpoch": 1,
    "state": "proposed",
    "updatedAt": "text",
    "verified": true
  }
]

Send a manual deal proposal

Send a manual deal proposal

POST//localhost:9090/api/send_deal
Body

Proposal

clientAddressstring

Client address

durationstring

Duration in epoch or in duration format, i.e. 1500000, 2400h

fileSizeinteger

File size in bytes for boost to fetch the CAR file

httpHeadersarray of string

http headers to be passed with the request (i.e. key=value)

ipniboolean

Whether the deal should be IPNI

keepUnsealedboolean

Whether the deal should be kept unsealed

pieceCidstring

Piece CID

pieceSizestring

Piece size

pricePerDealnumber

Price in FIL per deal

pricePerGbnumber

Price in FIL per GiB

pricePerGbEpochnumber

Price in FIL per GiB per epoch

providerIdstring

Provider ID

rootCidstring

Root CID that is required as part of the deal proposal, if empty, will be set to empty CID

startDelaystring

Deal start delay in epoch or in duration format, i.e. 1000, 72h

urlTemplatestring

URL template with PIECE_CID placeholder for boost to fetch the CAR file, i.e. http://127.0.0.1/piece/{PIECE_CID}.car

verifiedboolean

Whether the deal should be verified

Response

OK

Body
clientIdstring
createdAtstring
dealIdinteger
endEpochinteger
errorMessagestring
idinteger
labelstring
lastVerifiedAtstring

LastVerifiedAt is the last time the deal was verified as active by the tracker

pieceCidstring
pieceSizeinteger
pricestring
proposalIdstring
providerstring
scheduleIdinteger

Associations

sectorStartEpochinteger
startEpochinteger
stateenum
proposedpublishedactiveexpiredproposal_expiredrejectedslashederror
updatedAtstring
verifiedboolean
Request
const response = await fetch('//localhost:9090/api/send_deal', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "duration": "12740h",
      "httpHeaders": [
        null
      ],
      "ipni": true,
      "keepUnsealed": true,
      "pricePerDeal": 0,
      "pricePerGb": 0,
      "pricePerGbEpoch": 0,
      "rootCid": "bafkqaaa",
      "startDelay": "72h",
      "verified": true
    }),
});
const data = await response.json();
Response
{
  "clientId": "text",
  "createdAt": "text",
  "dealId": 1,
  "endEpoch": 1,
  "errorMessage": "text",
  "id": 1,
  "label": "text",
  "lastVerifiedAt": "text",
  "pieceCid": "text",
  "pieceSize": 1,
  "price": "text",
  "proposalId": "text",
  "provider": "text",
  "scheduleId": 1,
  "sectorStartEpoch": 1,
  "startEpoch": 1,
  "state": "proposed",
  "updatedAt": "text",
  "verified": true
}

Last updated

Was this helpful?