Skip to main content
POST
/
markets
/
creditbook
/
build
Build loan
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/creditbook/build \
  --header 'Content-Type: application/json' \
  --header 'user-wallet: <user-wallet>' \
  --data '
{
  "steps": [
    {
      "type": "repay",
      "params": {}
    }
  ],
  "loan": "<string>"
}
'
{
  "loan": "<string>",
  "transactions": [
    {
      "message": "<string>",
      "signatures": [
        {
          "publicKey": "<string>",
          "signature": "<string>"
        }
      ]
    }
  ]
}

Headers

user-wallet
string
required

Wallet address of the borrower whose loan is being built or updated.

payer
string

Optional fee payer. Defaults to user-wallet when omitted.

Body

application/json
steps
object[]
required
loan
string

Optional existing loan address. Omit to start from a new flash-borrow step.

Response

Derived loan address and the transaction sequence produced by the requested build steps.

loan
string
required

Resulting loan address after the build flow completes.

transactions
object[]
required