Deposit collateral
curl --request POST \
--url https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit \
--header 'Content-Type: application/json' \
--header 'user-wallet: <user-wallet>' \
--data '
{
"loan": "<string>",
"depositMint": "<string>",
"amount": 123,
"assetType": 123,
"assetIdentifier": "<string>",
"assetIndexGuidance": [
123
]
}
'import requests
url = "https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit"
payload = {
"loan": "<string>",
"depositMint": "<string>",
"amount": 123,
"assetType": 123,
"assetIdentifier": "<string>",
"assetIndexGuidance": [123]
}
headers = {
"user-wallet": "<user-wallet>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'user-wallet': '<user-wallet>', 'Content-Type': 'application/json'},
body: JSON.stringify({
loan: '<string>',
depositMint: '<string>',
amount: 123,
assetType: 123,
assetIdentifier: '<string>',
assetIndexGuidance: [123]
})
};
fetch('https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'loan' => '<string>',
'depositMint' => '<string>',
'amount' => 123,
'assetType' => 123,
'assetIdentifier' => '<string>',
'assetIndexGuidance' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"user-wallet: <user-wallet>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit"
payload := strings.NewReader("{\n \"loan\": \"<string>\",\n \"depositMint\": \"<string>\",\n \"amount\": 123,\n \"assetType\": 123,\n \"assetIdentifier\": \"<string>\",\n \"assetIndexGuidance\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("user-wallet", "<user-wallet>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit")
.header("user-wallet", "<user-wallet>")
.header("Content-Type", "application/json")
.body("{\n \"loan\": \"<string>\",\n \"depositMint\": \"<string>\",\n \"amount\": 123,\n \"assetType\": 123,\n \"assetIdentifier\": \"<string>\",\n \"assetIndexGuidance\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["user-wallet"] = '<user-wallet>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loan\": \"<string>\",\n \"depositMint\": \"<string>\",\n \"amount\": 123,\n \"assetType\": 123,\n \"assetIdentifier\": \"<string>\",\n \"assetIndexGuidance\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"signatures": [
{
"publicKey": "<string>",
"signature": "<string>"
}
]
}"Something went wrong: You have an error in your SQL syntax.""Failed to deserialize the JSON body into the target type: missing field `mints` at line 1 column 1."Borrowing
Deposit collateral
Adds more collateral to an existing loan position.
POST
/
markets
/
creditbook
/
collateral
/
deposit
Deposit collateral
curl --request POST \
--url https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit \
--header 'Content-Type: application/json' \
--header 'user-wallet: <user-wallet>' \
--data '
{
"loan": "<string>",
"depositMint": "<string>",
"amount": 123,
"assetType": 123,
"assetIdentifier": "<string>",
"assetIndexGuidance": [
123
]
}
'import requests
url = "https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit"
payload = {
"loan": "<string>",
"depositMint": "<string>",
"amount": 123,
"assetType": 123,
"assetIdentifier": "<string>",
"assetIndexGuidance": [123]
}
headers = {
"user-wallet": "<user-wallet>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'user-wallet': '<user-wallet>', 'Content-Type': 'application/json'},
body: JSON.stringify({
loan: '<string>',
depositMint: '<string>',
amount: 123,
assetType: 123,
assetIdentifier: '<string>',
assetIndexGuidance: [123]
})
};
fetch('https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'loan' => '<string>',
'depositMint' => '<string>',
'amount' => 123,
'assetType' => 123,
'assetIdentifier' => '<string>',
'assetIndexGuidance' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"user-wallet: <user-wallet>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit"
payload := strings.NewReader("{\n \"loan\": \"<string>\",\n \"depositMint\": \"<string>\",\n \"amount\": 123,\n \"assetType\": 123,\n \"assetIdentifier\": \"<string>\",\n \"assetIndexGuidance\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("user-wallet", "<user-wallet>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit")
.header("user-wallet", "<user-wallet>")
.header("Content-Type", "application/json")
.body("{\n \"loan\": \"<string>\",\n \"depositMint\": \"<string>\",\n \"amount\": 123,\n \"assetType\": 123,\n \"assetIdentifier\": \"<string>\",\n \"assetIndexGuidance\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/creditbook/collateral/deposit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["user-wallet"] = '<user-wallet>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loan\": \"<string>\",\n \"depositMint\": \"<string>\",\n \"amount\": 123,\n \"assetType\": 123,\n \"assetIdentifier\": \"<string>\",\n \"assetIndexGuidance\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"signatures": [
{
"publicKey": "<string>",
"signature": "<string>"
}
]
}"Something went wrong: You have an error in your SQL syntax.""Failed to deserialize the JSON body into the target type: missing field `mints` at line 1 column 1."Headers
Wallet address of the borrower adding collateral.
Optional fee payer. Defaults to user-wallet when omitted.
Body
application/json
Loopscale collateral asset type enum value.
Collateral asset identifier used by market information.
Optional oracle asset ordering hints used by Loopscale when validating a transaction.
Show child attributes
Show child attributes
⌘I