pool/poolrpc/trader.swagger.json
2020-10-12 19:51:27 -07:00

1511 lines
49 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "trader.proto",
"version": "version not set"
},
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/v1/lsat/tokens": {
"get": {
"summary": "pool: `listauth`\nGetLsatTokens returns all LSAT tokens the daemon ever paid for.",
"operationId": "GetLsatTokens",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcTokensResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"tags": [
"Trader"
]
}
},
"/v1/pool/accounts": {
"get": {
"summary": "pool: `accounts list`\nListAccounts returns a list of all accounts known to the trader daemon and\ntheir current state.",
"operationId": "ListAccounts",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcListAccountsResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"tags": [
"Trader"
]
},
"delete": {
"summary": "pool: `accounts close`\nCloseAccount closes an account and returns the funds locked in that account\nto the connected lnd node's wallet.",
"operationId": "CloseAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcCloseAccountResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "trader_key",
"description": "The trader key associated with the account that will be closed.",
"in": "query",
"required": false,
"type": "string",
"format": "byte"
},
{
"name": "output_with_fee.address",
"description": "The address corresponding to the output.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "output_with_fee.conf_target",
"description": "The target number of blocks that the transaction should be confirmed in.",
"in": "query",
"required": false,
"type": "integer",
"format": "int64"
},
{
"name": "output_with_fee.fee_rate_sat_per_kw",
"description": "The fee rate, in satoshis per kw, to use for the withdrawal transaction.",
"in": "query",
"required": false,
"type": "string",
"format": "uint64"
}
],
"tags": [
"Trader"
]
},
"post": {
"summary": "pool: `accounts new`\nInitAccount creates a new account with the requested size and expiration,\nfunding it from the wallet of the connected lnd node.",
"operationId": "InitAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcAccount"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcInitAccountRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/accounts/bump": {
"post": {
"summary": "pool: `accounts bumpfee`\nBumpAccountFee attempts to bump the fee of an account's transaction through\nchild-pays-for-parent (CPFP). Since the CPFP is performed through the\nbacking lnd node, the account transaction must contain an output under its\ncontrol for a successful bump. If a CPFP has already been performed for an\naccount, and this RPC is invoked again, then a replacing transaction (RBF)\nof the child will be broadcast.",
"operationId": "BumpAccountFee",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcBumpAccountFeeResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcBumpAccountFeeRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/accounts/deposit": {
"post": {
"summary": "pool: `accounts deposit`\nDepositAccount adds more funds from the connected lnd node's wallet to an\naccount.",
"operationId": "DepositAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcDepositAccountResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcDepositAccountRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/accounts/quote": {
"post": {
"summary": "QuoteAccount gets a fee quote to fund an account of the given size with the\ngiven confirmation target. If the connected lnd wallet doesn't have enough\nbalance to fund an account of the requested size, an error is returned.",
"operationId": "QuoteAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcQuoteAccountResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcQuoteAccountRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/accounts/recover": {
"post": {
"summary": "pool: `accounts recover`\nRecoverAccounts queries the auction server for this trader daemon's accounts\nin case we lost our local account database.",
"operationId": "RecoverAccounts",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcRecoverAccountsResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcRecoverAccountsRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/accounts/withdraw": {
"post": {
"summary": "pool: `accounts withdraw`\nWithdrawAccount splits off parts of the account balance into the specified\noutputs while recreating the account with a reduced balance.",
"operationId": "WithdrawAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcWithdrawAccountResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcWithdrawAccountRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/batch/snapshot": {
"get": {
"summary": "pool: `auction snapshot`\nBatchSnapshot returns the snapshot of a past batch identified by its ID.",
"operationId": "BatchSnapshot",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcBatchSnapshotResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "batch_id",
"description": "The unique identifier of the batch encoded as a compressed pubkey.",
"in": "query",
"required": false,
"type": "string",
"format": "byte"
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/fee": {
"get": {
"summary": "pool: `auction fee`\nAuctionFee returns the current auction order execution fee specified by the\nauction server.",
"operationId": "AuctionFee",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcAuctionFeeResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"tags": [
"Trader"
]
}
},
"/v1/pool/lease_durations": {
"get": {
"summary": "pool: `auction leasedurations`\nLeaseDurations returns the current set of valid lease duration in the\nmarket as is, and also information w.r.t if the market is currently active.",
"operationId": "LeaseDurations",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcLeaseDurationResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"tags": [
"Trader"
]
}
},
"/v1/pool/leases": {
"get": {
"summary": "pool: `auction leases`\nLeases returns the list of channels that were either purchased or sold by\nthe trader within the auction.",
"operationId": "Leases",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcLeasesResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "batch_ids",
"description": "An optional list of batches to retrieve the leases of. If empty, leases\nthroughout all batches are returned.",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "byte"
},
"collectionFormat": "multi"
},
{
"name": "accounts",
"description": "An optional list of accounts to retrieve the leases of. If empty, leases\nfor all accounts are returned.",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "byte"
},
"collectionFormat": "multi"
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/node_ratings": {
"get": {
"summary": "pool: `auction ratings`\nReturns the Node Tier information for this target Lightning node, and other\nrelated ranking information.",
"operationId": "NodeRatings",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcNodeRatingResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "node_pubkeys",
"description": "The target node to obtain ratings information for.",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string",
"format": "byte"
},
"collectionFormat": "multi"
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/orders": {
"get": {
"summary": "pool: `orders list`\nListOrders returns a list of all active and archived orders that are\ncurrently known to the trader daemon.",
"operationId": "ListOrders",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcListOrdersResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "verbose",
"description": "Can be set to true to list the orders including all events, which can be\nvery verbose.",
"in": "query",
"required": false,
"type": "boolean",
"format": "boolean"
},
{
"name": "active_only",
"description": "Only list orders that are still active.",
"in": "query",
"required": false,
"type": "boolean",
"format": "boolean"
}
],
"tags": [
"Trader"
]
},
"post": {
"summary": "pool: `orders submit`\nSubmitOrder creates a new ask or bid order and submits for the given account\nand submits it to the auction server for matching.",
"operationId": "SubmitOrder",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcSubmitOrderResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/poolrpcSubmitOrderRequest"
}
}
],
"tags": [
"Trader"
]
}
},
"/v1/pool/orders/{order_nonce}": {
"delete": {
"summary": "pool: `orders cancel`\nCancelOrder cancels an active order with the auction server to remove it\nfrom future matching.",
"operationId": "CancelOrder",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/poolrpcCancelOrderResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/gatewayruntimeError"
}
}
},
"parameters": [
{
"name": "order_nonce",
"in": "path",
"required": true,
"type": "string",
"format": "byte"
}
],
"tags": [
"Trader"
]
}
}
},
"definitions": {
"InvalidOrderFailReason": {
"type": "string",
"enum": [
"INVALID_AMT"
],
"default": "INVALID_AMT"
},
"gatewayruntimeError": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"poolrpcAccount": {
"type": "object",
"properties": {
"trader_key": {
"type": "string",
"format": "byte",
"description": "The identifying component of an account. This is the key used for the trader\nin the 2-of-2 multi-sig construction of an account with an auctioneer."
},
"outpoint": {
"$ref": "#/definitions/poolrpcOutPoint",
"description": "The current outpoint associated with the account. This will change every\ntime the account has been updated."
},
"value": {
"type": "string",
"format": "uint64",
"description": "The current total amount of satoshis in the account."
},
"available_balance": {
"type": "string",
"format": "uint64",
"description": "The amount of satoshis in the account that is available, meaning not\nallocated to any oustanding orders."
},
"expiration_height": {
"type": "integer",
"format": "int64",
"description": "The height at which the account will expire."
},
"state": {
"$ref": "#/definitions/poolrpcAccountState",
"description": "The current state of the account."
},
"latest_txid": {
"type": "string",
"format": "byte",
"description": "The hash of the account's latest transaction."
}
}
},
"poolrpcAccountState": {
"type": "string",
"enum": [
"PENDING_OPEN",
"PENDING_UPDATE",
"OPEN",
"EXPIRED",
"PENDING_CLOSED",
"CLOSED",
"RECOVERY_FAILED",
"PENDING_BATCH"
],
"default": "PENDING_OPEN",
"description": " - PENDING_OPEN: The state of an account when it is pending its confirmation on-chain.\n - PENDING_UPDATE: The state of an account when it has undergone an update on-chain either as\npart of a matched order or a trader modification and it is pending its\nconfirmation on-chain.\n - OPEN: The state of an account once it has confirmed on-chain.\n - EXPIRED: The state of an account once its expiration has been reached and its closing\ntransaction has confirmed.\n - PENDING_CLOSED: The state of an account when we're waiting for the closing transaction of\nan account to confirm that required cooperation with the auctioneer.\n - CLOSED: The state of an account once its closing transaction has confirmed.\n - RECOVERY_FAILED: The state of an account that indicates that the account was attempted to be\nrecovered but failed because the opening transaction wasn't found by lnd.\nThis could be because it was never published or it never confirmed. Then the\nfunds are SAFU and the account can be considered to never have been opened\nin the first place.\n - PENDING_BATCH: The account has recently participated in a batch and is not yet confirmed."
},
"poolrpcAsk": {
"type": "object",
"properties": {
"details": {
"$ref": "#/definitions/poolrpcOrder",
"description": "The common fields shared between both ask and bid order types."
},
"lease_duration_blocks": {
"type": "integer",
"format": "int64",
"description": "The number of blocks the liquidity provider is willing to provide the\nchannel funds for."
},
"version": {
"type": "integer",
"format": "int64",
"description": "The version of the order format that is used. Will be increased once new\nfeatures are added."
}
}
},
"poolrpcAskSnapshot": {
"type": "object",
"properties": {
"version": {
"type": "integer",
"format": "int64",
"description": "The version of the order."
},
"lease_duration_blocks": {
"type": "integer",
"format": "int64",
"description": "The period of time the channel will survive for."
},
"rate_fixed": {
"type": "integer",
"format": "int64",
"description": "The true bid price of the order in parts per billion."
},
"chan_type": {
"type": "integer",
"format": "int64",
"description": "The channel type to be created."
}
}
},
"poolrpcAuctionFeeResponse": {
"type": "object",
"properties": {
"execution_fee": {
"$ref": "#/definitions/poolrpcExecutionFee",
"description": "The execution fee charged per matched order."
}
}
},
"poolrpcBatchSnapshotResponse": {
"type": "object",
"properties": {
"version": {
"type": "integer",
"format": "int64",
"description": "The version of the batch."
},
"batch_id": {
"type": "string",
"format": "byte",
"description": "The unique identifier of the batch."
},
"prev_batch_id": {
"type": "string",
"format": "byte",
"description": "The unique identifier of the prior batch."
},
"clearing_price_rate": {
"type": "integer",
"format": "int64",
"description": "The uniform clearing price rate in parts per billion of the batch."
},
"matched_orders": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcMatchedOrderSnapshot"
},
"description": "The set of all orders matched in the batch."
},
"batch_tx_id": {
"type": "string",
"description": "The txid of the batch transaction."
},
"batch_tx": {
"type": "string",
"format": "byte",
"description": "The batch transaction including all witness data."
}
}
},
"poolrpcBid": {
"type": "object",
"properties": {
"details": {
"$ref": "#/definitions/poolrpcOrder",
"description": "The common fields shared between both ask and bid order types."
},
"lease_duration_blocks": {
"type": "integer",
"format": "int64",
"description": "Required number of blocks that a channel opened as a result of this bid\nshould be kept open."
},
"version": {
"type": "integer",
"format": "int64",
"description": "The version of the order format that is used. Will be increased once new\nfeatures are added."
},
"min_node_tier": {
"$ref": "#/definitions/poolrpcNodeTier",
"description": "The minium node tier this order should be matched with. Only asks backed by\na node this tier or higher will be eligible for matching with this bid."
}
}
},
"poolrpcBidSnapshot": {
"type": "object",
"properties": {
"version": {
"type": "integer",
"format": "int64",
"description": "The version of the order."
},
"lease_duration_blocks": {
"type": "integer",
"format": "int64",
"description": "The period of time the matched channel should be allocated for."
},
"rate_fixed": {
"type": "integer",
"format": "int64",
"description": "The true bid price of the order in parts per billion."
},
"chan_type": {
"type": "integer",
"format": "int64",
"description": "The channel type to be created."
}
}
},
"poolrpcBumpAccountFeeRequest": {
"type": "object",
"properties": {
"trader_key": {
"type": "string",
"format": "byte",
"description": "The trader key associated with the account that will have its fee bumped."
},
"fee_rate_sat_per_kw": {
"type": "string",
"format": "uint64",
"description": "The new fee rate, in satoshis per kw, to use for the child of the account\ntransaction."
}
}
},
"poolrpcBumpAccountFeeResponse": {
"type": "object"
},
"poolrpcCancelOrderResponse": {
"type": "object"
},
"poolrpcCloseAccountResponse": {
"type": "object",
"properties": {
"close_txid": {
"type": "string",
"format": "byte",
"description": "The hash of the closing transaction."
}
}
},
"poolrpcDepositAccountRequest": {
"type": "object",
"properties": {
"trader_key": {
"type": "string",
"format": "byte",
"description": "The trader key associated with the account that funds will be deposited\ninto."
},
"amount_sat": {
"type": "string",
"format": "uint64",
"description": "The amount in satoshis to deposit into the account."
},
"fee_rate_sat_per_kw": {
"type": "string",
"format": "uint64",
"description": "The fee rate, in satoshis per kw, to use for the deposit transaction."
}
}
},
"poolrpcDepositAccountResponse": {
"type": "object",
"properties": {
"account": {
"$ref": "#/definitions/poolrpcAccount",
"description": "The state of the account after processing the deposit."
},
"deposit_txid": {
"type": "string",
"format": "byte",
"description": "The transaction used to deposit funds into the account."
}
}
},
"poolrpcExecutionFee": {
"type": "object",
"properties": {
"base_fee": {
"type": "string",
"format": "uint64",
"description": "The base fee in satoshis charged per order, regardless of the matched size."
},
"fee_rate": {
"type": "string",
"format": "uint64",
"description": "The fee rate in parts per million."
}
}
},
"poolrpcInitAccountRequest": {
"type": "object",
"properties": {
"account_value": {
"type": "string",
"format": "uint64"
},
"absolute_height": {
"type": "integer",
"format": "int64"
},
"relative_height": {
"type": "integer",
"format": "int64"
},
"conf_target": {
"type": "integer",
"format": "int64",
"description": "The target number of blocks that the transaction should be confirmed in."
}
}
},
"poolrpcInvalidOrder": {
"type": "object",
"properties": {
"order_nonce": {
"type": "string",
"format": "byte"
},
"fail_reason": {
"$ref": "#/definitions/InvalidOrderFailReason"
},
"fail_string": {
"type": "string"
}
}
},
"poolrpcLease": {
"type": "object",
"properties": {
"channel_point": {
"$ref": "#/definitions/poolrpcOutPoint",
"description": "The outpoint of the channel created."
},
"channel_amt_sat": {
"type": "string",
"format": "uint64",
"description": "The amount, in satoshis, of the channel created."
},
"channel_duration_blocks": {
"type": "integer",
"format": "int64",
"description": "The intended duration, in blocks, of the channel created."
},
"channel_lease_expiry": {
"type": "integer",
"format": "int64",
"description": "The absolute height that this channel lease expires."
},
"premium_sat": {
"type": "string",
"format": "uint64",
"description": "The premium, in satoshis, either paid or received for the offered liquidity."
},
"execution_fee_sat": {
"type": "string",
"format": "uint64",
"description": "The execution fee, in satoshis, charged by the auctioneer for the channel\ncreated."
},
"chain_fee_sat": {
"type": "string",
"format": "uint64",
"description": "The fee, in satoshis, charged by the auctioneer for the batch execution\ntransaction that created this lease."
},
"clearing_rate_price": {
"type": "string",
"format": "uint64",
"description": "The actual fixed rate expressed in parts per billionth this lease was\nbought/sold at."
},
"order_fixed_rate": {
"type": "string",
"format": "uint64",
"description": "The actual fixed rate of the bid/ask, this should always be 'better' than\nthe clearing_rate_price."
},
"order_nonce": {
"type": "string",
"format": "byte",
"description": "The order executed that resulted in the channel created."
},
"purchased": {
"type": "boolean",
"format": "boolean",
"description": "Whether this channel was purchased from another trader or not."
},
"channel_remote_node_key": {
"type": "string",
"format": "byte",
"description": "The pubkey of the node that this channel was bought/sold from."
},
"channel_node_tier": {
"$ref": "#/definitions/poolrpcNodeTier",
"description": "The tier of the node that this channel was bought/sold from."
}
}
},
"poolrpcLeaseDurationResponse": {
"type": "object",
"properties": {
"lease_durations": {
"type": "object",
"additionalProperties": {
"type": "boolean",
"format": "boolean"
}
}
}
},
"poolrpcLeasesResponse": {
"type": "object",
"properties": {
"leases": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcLease"
},
"description": "The relevant list of leases purchased or sold within the auction."
},
"total_amt_earned_sat": {
"type": "string",
"format": "uint64",
"description": "The total amount of satoshis earned from the leases returned."
},
"total_amt_paid_sat": {
"type": "string",
"format": "uint64",
"description": "The total amount of satoshis paid for the leases returned."
}
}
},
"poolrpcListAccountsResponse": {
"type": "object",
"properties": {
"accounts": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcAccount"
}
}
}
},
"poolrpcListOrdersResponse": {
"type": "object",
"properties": {
"asks": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcAsk"
}
},
"bids": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcBid"
}
}
}
},
"poolrpcLsatToken": {
"type": "object",
"properties": {
"base_macaroon": {
"type": "string",
"format": "byte",
"description": "*\nThe base macaroon that was baked by the auth server."
},
"payment_hash": {
"type": "string",
"format": "byte",
"description": "*\nThe payment hash of the payment that was paid to obtain the token."
},
"payment_preimage": {
"type": "string",
"format": "byte",
"description": "*\nThe preimage of the payment hash, knowledge of this is proof that the\npayment has been paid. If the preimage is set to all zeros, this means the\npayment is still pending and the token is not yet fully valid."
},
"amount_paid_msat": {
"type": "string",
"format": "int64",
"description": "*\nThe amount of millisatoshis that was paid to get the token."
},
"routing_fee_paid_msat": {
"type": "string",
"format": "int64",
"description": "*\nThe amount of millisatoshis paid in routing fee to pay for the token."
},
"time_created": {
"type": "string",
"format": "int64",
"description": "*\nThe creation time of the token as UNIX timestamp in seconds."
},
"expired": {
"type": "boolean",
"format": "boolean",
"description": "*\nIndicates whether the token is expired or still valid."
},
"storage_name": {
"type": "string",
"description": "*\nIdentifying attribute of this token in the store. Currently represents the\nfile name of the token where it's stored on the file system."
}
}
},
"poolrpcMatchEvent": {
"type": "object",
"properties": {
"match_state": {
"$ref": "#/definitions/poolrpcMatchState",
"description": "The state of the match making process the order went through."
},
"units_filled": {
"type": "integer",
"format": "int64",
"description": "The number of units that would be (or were) filled with this match."
},
"matched_order": {
"type": "string",
"format": "byte",
"description": "The nonce of the order we were matched to."
},
"reject_reason": {
"$ref": "#/definitions/poolrpcMatchRejectReason",
"description": "The reason why the trader daemon rejected the order. Is only set if\nmatch_state is set to REJECTED."
}
}
},
"poolrpcMatchRejectReason": {
"type": "string",
"enum": [
"NONE",
"SERVER_MISBEHAVIOR",
"BATCH_VERSION_MISMATCH",
"PARTIAL_REJECT_COLLATERAL",
"PARTIAL_REJECT_DUPLICATE_PEER",
"PARTIAL_REJECT_CHANNEL_FUNDING_FAILED"
],
"default": "NONE",
"description": " - NONE: No reject occurred, this is the default value.\n - SERVER_MISBEHAVIOR: The client didn't come up with the same result as the server and is\nrejecting the batch because of that.\n - BATCH_VERSION_MISMATCH: The client doesn't support the current batch verification version the\nserver is using.\n - PARTIAL_REJECT_COLLATERAL: The client rejects some of the orders, not the full batch. This reason is\nset on matches for orders that were in the same batch as partial reject ones\nbut were not themselves rejected.\n - PARTIAL_REJECT_DUPLICATE_PEER: The trader's client has a preference to only match orders with peers it\ndoesn't already have channels with. The order that is rejected with this\nreason type comes from a peer that the trader already has channels with.\n - PARTIAL_REJECT_CHANNEL_FUNDING_FAILED: The trader's client couldn't connect to the remote node of the matched\norder or the channel funding could not be initialized for another\nreason. This could also be the rejecting node's fault if their\nconnection is not stable. Using this code can have a negative impact on\nthe reputation score of both nodes, depending on the number of errors\nrecorded."
},
"poolrpcMatchState": {
"type": "string",
"enum": [
"PREPARE",
"ACCEPTED",
"REJECTED",
"SIGNED",
"FINALIZED"
],
"default": "PREPARE",
"description": " - PREPARE: The OrderMatchPrepare message from the auctioneer was received initially.\n - ACCEPTED: The OrderMatchPrepare message from the auctioneer was processed successfully\nand the batch was accepted.\n - REJECTED: The order was rejected by the trader daemon, either as an answer to a\nOrderMatchSignBegin or OrderMatchFinalize message from the auctioneer.\n - SIGNED: The OrderMatchSignBegin message from the auctioneer was processed\nsuccessfully.\n - FINALIZED: The OrderMatchFinalize message from the auctioneer was processed\nsuccessfully."
},
"poolrpcMatchedOrderSnapshot": {
"type": "object",
"properties": {
"ask": {
"$ref": "#/definitions/poolrpcAskSnapshot",
"description": "The full ask order that was matched."
},
"bid": {
"$ref": "#/definitions/poolrpcBidSnapshot",
"description": "The full bid order that was matched."
},
"matching_rate": {
"type": "integer",
"format": "int64",
"description": "The fixed rate premium that was matched, expressed in parts-ber-billion."
},
"total_sats_cleared": {
"type": "string",
"format": "uint64",
"description": "The total number of satoshis that were bought."
},
"units_matched": {
"type": "integer",
"format": "int64",
"description": "The total number of units that were matched."
}
}
},
"poolrpcNodeRating": {
"type": "object",
"properties": {
"node_pubkey": {
"type": "string",
"format": "byte",
"description": "The pubkey for the node these ratings belong to."
},
"node_tier": {
"$ref": "#/definitions/poolrpcNodeTier",
"description": "The tier of the target node."
}
}
},
"poolrpcNodeRatingResponse": {
"type": "object",
"properties": {
"node_ratings": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcNodeRating"
},
"description": "A series of node ratings for each of the queried nodes."
}
}
},
"poolrpcNodeTier": {
"type": "string",
"enum": [
"TIER_DEFAULT",
"TIER_0",
"TIER_1"
],
"default": "TIER_DEFAULT",
"description": " - TIER_DEFAULT: The default node tier. This value will be determined at run-time by the\ncurrent order version.\n - TIER_0: Tier 0, bid with this tier are opting out of the smaller \"higher\nquality\" pool of nodes to match their bids. Nodes in this tier are\nconsidered to have \"no rating\".\n - TIER_1: Tier 1, the \"base\" node tier. Nodes in this tier are shown to have a\nhigher degree of up time and route-ability compared to the rest of the\nnodes in the network. This is the current default node tier when\nsubmitting bid orders."
},
"poolrpcOrder": {
"type": "object",
"properties": {
"trader_key": {
"type": "string",
"format": "byte",
"description": "The trader's account key of the account that is used for the order."
},
"rate_fixed": {
"type": "integer",
"format": "int64",
"description": "Fixed order rate in parts per billion."
},
"amt": {
"type": "string",
"format": "uint64",
"description": "Order amount in satoshis."
},
"max_batch_fee_rate_sat_per_kw": {
"type": "string",
"format": "uint64",
"description": "Maximum fee rate the trader is willing to pay for the batch transaction,\nexpressed in satoshis per 1000 weight units (sat/KW)."
},
"order_nonce": {
"type": "string",
"format": "byte",
"description": "Order nonce, acts as unique order identifier."
},
"state": {
"$ref": "#/definitions/poolrpcOrderState",
"description": "The state the order currently is in."
},
"units": {
"type": "integer",
"format": "int64",
"description": "The number of order units the amount corresponds to."
},
"units_unfulfilled": {
"type": "integer",
"format": "int64",
"description": "The number of currently unfilled units of this order. This will be equal to\nthe total amount of units until the order has reached the state PARTIAL_FILL\nor EXECUTED."
},
"reserved_value_sat": {
"type": "string",
"format": "uint64",
"description": "The value reserved from the account by this order to ensure the account\ncan pay execution and chain fees in case it gets matched."
},
"creation_timestamp_ns": {
"type": "string",
"format": "uint64",
"description": "The unix timestamp in nanoseconds the order was first created/submitted."
},
"events": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcOrderEvent"
},
"description": "A list of events that were emitted for this order. This field is only set\nwhen the verbose flag is set to true in the request."
},
"min_units_match": {
"type": "integer",
"format": "int64",
"description": "The minimum number of order units that must be matched per order pair."
}
}
},
"poolrpcOrderEvent": {
"type": "object",
"properties": {
"timestamp_ns": {
"type": "string",
"format": "int64",
"description": "The unix timestamp in nanoseconds the event was emitted at. This is the\nprimary key of the event and is unique across the database."
},
"event_str": {
"type": "string",
"description": "The human readable representation of the event."
},
"state_change": {
"$ref": "#/definitions/poolrpcUpdatedEvent",
"description": "The order was updated in the database."
},
"matched": {
"$ref": "#/definitions/poolrpcMatchEvent",
"description": "The order was involved in a match making attempt."
}
}
},
"poolrpcOrderState": {
"type": "string",
"enum": [
"ORDER_SUBMITTED",
"ORDER_CLEARED",
"ORDER_PARTIALLY_FILLED",
"ORDER_EXECUTED",
"ORDER_CANCELED",
"ORDER_EXPIRED",
"ORDER_FAILED"
],
"default": "ORDER_SUBMITTED"
},
"poolrpcOutPoint": {
"type": "object",
"properties": {
"txid": {
"type": "string",
"format": "byte",
"description": "Raw bytes representing the transaction id."
},
"output_index": {
"type": "integer",
"format": "int64",
"description": "The index of the output on the transaction."
}
}
},
"poolrpcOutput": {
"type": "object",
"properties": {
"value_sat": {
"type": "string",
"format": "uint64",
"description": "The value, in satoshis, of the output."
},
"address": {
"type": "string",
"description": "The address corresponding to the output."
}
}
},
"poolrpcOutputWithFee": {
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "The address corresponding to the output."
},
"conf_target": {
"type": "integer",
"format": "int64",
"description": "The target number of blocks that the transaction should be confirmed in."
},
"fee_rate_sat_per_kw": {
"type": "string",
"format": "uint64",
"description": "The fee rate, in satoshis per kw, to use for the withdrawal transaction."
}
}
},
"poolrpcOutputsWithImplicitFee": {
"type": "object",
"properties": {
"outputs": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcOutput"
}
}
}
},
"poolrpcQuoteAccountRequest": {
"type": "object",
"properties": {
"account_value": {
"type": "string",
"format": "uint64"
},
"conf_target": {
"type": "integer",
"format": "int64",
"description": "The target number of blocks that the transaction should be confirmed in."
}
}
},
"poolrpcQuoteAccountResponse": {
"type": "object",
"properties": {
"miner_fee_rate_sat_per_kw": {
"type": "string",
"format": "uint64"
},
"miner_fee_total": {
"type": "string",
"format": "uint64"
}
}
},
"poolrpcRecoverAccountsRequest": {
"type": "object"
},
"poolrpcRecoverAccountsResponse": {
"type": "object",
"properties": {
"num_recovered_accounts": {
"type": "integer",
"format": "int64",
"description": "The number of accounts that were recovered."
}
}
},
"poolrpcSubmitOrderRequest": {
"type": "object",
"properties": {
"ask": {
"$ref": "#/definitions/poolrpcAsk"
},
"bid": {
"$ref": "#/definitions/poolrpcBid"
}
}
},
"poolrpcSubmitOrderResponse": {
"type": "object",
"properties": {
"invalid_order": {
"$ref": "#/definitions/poolrpcInvalidOrder",
"description": "Order failed with the given reason."
},
"accepted_order_nonce": {
"type": "string",
"format": "byte",
"description": "The order nonce of the accepted order."
}
}
},
"poolrpcTokensResponse": {
"type": "object",
"properties": {
"tokens": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcLsatToken"
},
"description": "*\nList of all tokens the daemon knows of, including old/expired tokens."
}
}
},
"poolrpcUpdatedEvent": {
"type": "object",
"properties": {
"previous_state": {
"$ref": "#/definitions/poolrpcOrderState",
"description": "The state of the order previous to the change. This is what the state\nchanged from."
},
"new_state": {
"$ref": "#/definitions/poolrpcOrderState",
"description": "The new state of the order after the change. This is what the state changed\nto."
},
"units_filled": {
"type": "integer",
"format": "int64",
"description": "The units that were filled at the time of the event."
}
}
},
"poolrpcWithdrawAccountRequest": {
"type": "object",
"properties": {
"trader_key": {
"type": "string",
"format": "byte",
"description": "The trader key associated with the account that funds will be withdrawed\nfrom."
},
"outputs": {
"type": "array",
"items": {
"$ref": "#/definitions/poolrpcOutput"
},
"description": "The outputs we'll withdraw funds from the account into."
},
"fee_rate_sat_per_kw": {
"type": "string",
"format": "uint64",
"description": "The fee rate, in satoshis per kw, to use for the withdrawal transaction."
}
}
},
"poolrpcWithdrawAccountResponse": {
"type": "object",
"properties": {
"account": {
"$ref": "#/definitions/poolrpcAccount",
"description": "The state of the account after processing the withdrawal."
},
"withdraw_txid": {
"type": "string",
"format": "byte",
"description": "The transaction used to withdraw funds from the account."
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"type_url": {
"type": "string"
},
"value": {
"type": "string",
"format": "byte"
}
}
}
}
}