Skip to content

Commit

Permalink
docs: add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Dec 16, 2024
1 parent c298db0 commit 8df8e33
Showing 1 changed file with 77 additions and 47 deletions.
124 changes: 77 additions & 47 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ paths:
text/plain:
schema:
type: string

/bus/accounts/fund:
post:
summary: Fund account
Expand Down Expand Up @@ -883,6 +884,7 @@ paths:
text/plain:
schema:
type: string

/bus/alerts/dismiss:
post:
summary: Dismiss alerts
Expand All @@ -903,6 +905,7 @@ paths:
text/plain:
schema:
type: string

/bus/alerts/register:
post:
summary: Register an alert
Expand Down Expand Up @@ -1032,6 +1035,7 @@ paths:
text/plain:
schema:
type: string

/bus/bucket/{name}/policy:
put:
summary: Update bucket policy
Expand Down Expand Up @@ -1074,6 +1078,7 @@ paths:
text/plain:
schema:
type: string

/bus/bucket/{name}:
get:
summary: Get bucket
Expand Down Expand Up @@ -1158,6 +1163,7 @@ paths:
text/plain:
schema:
type: string

/bus/consensus/network:
get:
summary: Get network details
Expand All @@ -1169,6 +1175,7 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Network"

/bus/consensus/siafundfee/{payout}:
get:
summary: Get siafund fee
Expand All @@ -1193,6 +1200,7 @@ paths:
text/plain:
schema:
type: string

/bus/consensus/state:
get:
summary: Get consensus state
Expand All @@ -1216,6 +1224,7 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/SyncerAddress"

/bus/syncer/connect:
post:
summary: Connect to a syncer
Expand All @@ -1236,6 +1245,7 @@ paths:
text/plain:
schema:
type: string

/bus/syncer/peers:
get:
summary: Get syncer peers
Expand Down Expand Up @@ -1267,6 +1277,7 @@ paths:
text/plain:
schema:
type: string

/bus/txpool/transactions:
get:
summary: Get all transactions
Expand All @@ -1286,6 +1297,7 @@ paths:
text/plain:
schema:
type: string

/bus/txpool/broadcast:
post:
summary: Broadcast transaction
Expand Down Expand Up @@ -1347,6 +1359,7 @@ paths:
text/plain:
schema:
type: string

/bus/wallet/events:
get:
summary: Get wallet events
Expand Down Expand Up @@ -1394,6 +1407,7 @@ paths:
text/plain:
schema:
type: string

/bus/wallet/pending:
get:
summary: Get unconfirmed events
Expand All @@ -1413,6 +1427,7 @@ paths:
text/plain:
schema:
type: string

/bus/wallet/redistribute:
post:
summary: Redistribute wallet funds
Expand Down Expand Up @@ -1452,6 +1467,7 @@ paths:
text/plain:
schema:
type: string

/bus/wallet/send:
post:
summary: Send siacoins
Expand Down Expand Up @@ -1617,9 +1633,9 @@ components:
type: object
properties:
height:
type: integer
format: uint64
description: The height of the block in the blockchain
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The height of the block in the blockchain
id:
allOf:
- $ref: "#/components/schemas/BlockID"
Expand Down Expand Up @@ -1701,13 +1717,13 @@ components:
- $ref: "#/components/schemas/Hash256"
- description: The Merkle root of the contract's data.
windowStart:
type: integer
format: uint64
description: The block height when the contract's proof window starts.
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height when the contract's proof window starts.
windowEnd:
type: integer
format: uint64
description: The block height when the contract's proof window ends.
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height when the contract's proof window ends.
payout:
allOf:
- $ref: "#/components/schemas/Currency"
Expand All @@ -1723,11 +1739,9 @@ components:
items:
$ref: "#/components/schemas/SiacoinOutput"
unlockHash:
$ref: "#/components/schemas/Address"
$ref: "#/components/schemas/Address"
revisionNumber:
type: integer
format: uint64
description: The revision number of the contract.
$ref: "#/components/schemas/RevisionNumber"

FileContractID:
allOf:
Expand Down Expand Up @@ -1755,13 +1769,13 @@ components:
- $ref: "#/components/schemas/Hash256"
- description: The updated Merkle root of the file's data.
windowStart:
type: integer
format: uint64
description: The block height when the revised proof window starts.
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height when the revised proof window starts.
windowEnd:
type: integer
format: uint64
description: The block height when the revised proof window ends.
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height when the revised proof window ends.
validProofOutputs:
type: array
description: Updated outputs if the revised contract is successfully fulfilled.
Expand All @@ -1777,9 +1791,7 @@ components:
- $ref: "#/components/schemas/Address"
- description: The updated hash of the conditions required to unlock the contract funds.
revisionNumber:
type: integer
format: uint64
description: The updated revision number of the contract.
$ref: "#/components/schemas/RevisionNumber"

Hash256:
type: string
Expand All @@ -1799,8 +1811,7 @@ components:
signature:
type: array
items:
type: string
format: byte
$ref: "#/components/schemas/Signature"
preimages:
type: array
items:
Expand All @@ -1823,9 +1834,9 @@ components:
- $ref: "#/components/schemas/SiacoinOutput"
- description: The output of the element
maturityHeight:
type: integer
format: uint64
description: The block height when the output matures
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height when the output matures

SiacoinInput:
type: object
Expand Down Expand Up @@ -2024,25 +2035,25 @@ components:
format: uint64
description: The index of the public key used to sign the transaction
timelock:
type: integer
format: uint64
description: The block height at which the output can be spent
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height at which the outputs in the transaction can be spent
coveredFields:
allOf:
- $ref: "#/components/schemas/CoveredFields"
- description: Indicates which fields of the transaction are covered by the signature
signature:
type: string
format: byte
description: The signature of the transaction
allOf:
- $ref: "#/components/schemas/Signature"
- description: The signature of the transaction

UnlockConditions:
type: object
properties:
timelock:
type: integer
format: uint64
description: The block height at which the output can be spent
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height at which the outputs can be spent
publicKeys:
type: array
items:
Expand All @@ -2066,9 +2077,9 @@ components:
type: object
properties:
height:
type: integer
format: uint64
description: The height of the block
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The height of the block
commitment:
$ref: "#/components/schemas/Hash256"
transactions:
Expand Down Expand Up @@ -2106,8 +2117,7 @@ components:
hostPublicKey:
$ref: "#/components/schemas/PublicKey"
revisionNumber:
type: integer
format: uint64
$ref: "#/components/schemas/RevisionNumber"
renterSignature:
$ref: "#/components/schemas/Signature"
hostSignature:
Expand Down Expand Up @@ -2222,6 +2232,12 @@ components:
hosts:
$ref: "#/components/schemas/HostsConfig"

BlockHeight:
type: integer
format: uint64
description: The height of a block
example: 92813

Bucket:
type: object
properties:
Expand Down Expand Up @@ -2270,9 +2286,9 @@ components:
type: object
properties:
blockHeight:
type: integer
format: uint64
description: The current block height
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The current block height
lastBlockTime:
type: string
format: date-time
Expand Down Expand Up @@ -2347,13 +2363,21 @@ components:
description: The number of blocks on top of the block that triggered the creation of this event
type:
type: string
enum:
- miner
- foundation
- siafundClaim
- v1Transaction
- v1ContractResolution
- v2Transaction
- v2ContractResolution
description: The type of the event
data:
type: object
maturityHeight:
type: integer
format: uint64
description: The block height when the event's data can be used
allOf:
- $ref: "#/components/schemas/BlockHeight"
- description: The block height at which the payout matures.
timestamp:
type: string
format: date-time
Expand Down Expand Up @@ -2564,6 +2588,12 @@ components:
format: int32
description: The number of total data shards a piece of an object gets erasure-coded into

RevisionNumber:
type: integer
format: uint64
description: The revision number of the contract
example: 246

Sector:
type: object
description: Description of an uploaded sector
Expand Down

0 comments on commit 8df8e33

Please sign in to comment.