Rates and Loan Terms
Confirm Extension Transaction
Record a mined extension transaction and read what it changed
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
extensions
/
confirm-tx
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/extensions/confirm-tx" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "txHash": "0xe9eb82dcbafb24c0eda225c2b18201928847ee7d37b9baeda3361c250432168d" }'
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/extensions/confirm-tx`,
{
method: 'POST',
headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ txHash: tx.hash })
}
);
const { data } = await res.json();
if (data.noOp) console.warn(data.notice);
{
"success": true,
"data": {
"txHash": "0xe9eb82dcbafb24c0eda225c2b18201928847ee7d37b9baeda3361c250432168d",
"functionName": "applyExtension",
"signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"activity": [
{ "proposalId": "2", "event": "ExtensionApplied", "loanId": "1", "newDueAt": "1797292800" },
{ "proposalId": "2", "event": "ExtensionApplied", "loanId": "3", "newDueAt": "1797292800" }
],
"appliedLoans": ["1", "3"],
"noOp": false
}
}
{
"success": true,
"data": {
"txHash": "0x0ddbfbd173cec02dcd335720336ec72ced1e967714c36ae2bbf89e0871996267",
"functionName": "applyExtension",
"signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"activity": [],
"appliedLoans": [],
"noOp": true,
"outcome": "NO_LOAN_EXTENDED",
"notice": "The transaction mined but extended no loan: the market emitted no ExtensionApplied. Every loan in the page was either outside the batch (opened after the proposal was made), closed, or already at or past the proposal date, so no maturity moved. Propose a new extension for the loans that still need one."
}
}
{
"success": false,
"error": {
"code": "TX_WRONG_FUNCTION",
"message": "Transaction calls setConfig; expected proposeExtension or confirmExtension or applyExtension or cancelExtension or setAllowExtension"
}
}
Records any mined transaction of the extension flow: a proposal, a confirmation, an applied batch page, a cancellation, or the switch itself. The API verifies the receipt against the market, reads the extension events it carries, and brings each proposal it touched up to date from the chain.
The market assigns a proposal its ID only when the proposal mines, so confirming the proposing transaction here is how to learn it. List Extensions shows it too from then on.
Confirming the same hash again is safe. The records converge on the same state, and an applied page is counted once.
The transaction checks answer with the standard transaction verification errors:
An applied batch page can mine without extending anything. When every loan in the page was outside the batch, closed, or already at or past the proposed date, the response carries
noOp: true and outcome: "NO_LOAN_EXTENDED". The transaction still cost gas, and no maturity moved.Path Parameters
string
required
Market ID.
Body Parameters
string
required
Hash of the mined transaction. It must call
proposeExtension, confirmExtension, applyExtension, cancelExtension or setAllowExtension on this market.Response Fields
object
Show child attributes
Show child attributes
string
Transaction hash.
string
The function the transaction called.
string
The wallet that sent it.
array
The extension events the market emitted in this transaction, in log order. Empty for
setAllowExtension.array
IDs of the loans this transaction extended. A confirmed
LOAN proposal lists its loan here, and a FLOOR confirmation lists none.boolean
true only for an applyExtension that extended no loan.string
NO_LOAN_EXTENDED. Present only when noOp is true.string
Why nothing moved, and what to do about the loans that still need an extension. Present only when
noOp is true.curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/extensions/confirm-tx" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "txHash": "0xe9eb82dcbafb24c0eda225c2b18201928847ee7d37b9baeda3361c250432168d" }'
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/extensions/confirm-tx`,
{
method: 'POST',
headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ txHash: tx.hash })
}
);
const { data } = await res.json();
if (data.noOp) console.warn(data.notice);
{
"success": true,
"data": {
"txHash": "0xe9eb82dcbafb24c0eda225c2b18201928847ee7d37b9baeda3361c250432168d",
"functionName": "applyExtension",
"signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"activity": [
{ "proposalId": "2", "event": "ExtensionApplied", "loanId": "1", "newDueAt": "1797292800" },
{ "proposalId": "2", "event": "ExtensionApplied", "loanId": "3", "newDueAt": "1797292800" }
],
"appliedLoans": ["1", "3"],
"noOp": false
}
}
{
"success": true,
"data": {
"txHash": "0x0ddbfbd173cec02dcd335720336ec72ced1e967714c36ae2bbf89e0871996267",
"functionName": "applyExtension",
"signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"activity": [],
"appliedLoans": [],
"noOp": true,
"outcome": "NO_LOAN_EXTENDED",
"notice": "The transaction mined but extended no loan: the market emitted no ExtensionApplied. Every loan in the page was either outside the batch (opened after the proposal was made), closed, or already at or past the proposal date, so no maturity moved. Propose a new extension for the loans that still need one."
}
}
{
"success": false,
"error": {
"code": "TX_WRONG_FUNCTION",
"message": "Transaction calls setConfig; expected proposeExtension or confirmExtension or applyExtension or cancelExtension or setAllowExtension"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
MISSING_MARKET_ID | 400 | The marketId path segment is longer than 100 characters |
VALIDATION_ERROR | 400 | txHash is missing or is not a 32-byte hex hash |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
INTERNAL_ERROR | 500 | The chain could not be read. Retry shortly |
TX_NOT_FOUND, TX_REVERTED, TX_WRONG_TARGET and TX_WRONG_FUNCTION.⌘I
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/extensions/confirm-tx" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "txHash": "0xe9eb82dcbafb24c0eda225c2b18201928847ee7d37b9baeda3361c250432168d" }'
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/extensions/confirm-tx`,
{
method: 'POST',
headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
body: JSON.stringify({ txHash: tx.hash })
}
);
const { data } = await res.json();
if (data.noOp) console.warn(data.notice);
{
"success": true,
"data": {
"txHash": "0xe9eb82dcbafb24c0eda225c2b18201928847ee7d37b9baeda3361c250432168d",
"functionName": "applyExtension",
"signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"activity": [
{ "proposalId": "2", "event": "ExtensionApplied", "loanId": "1", "newDueAt": "1797292800" },
{ "proposalId": "2", "event": "ExtensionApplied", "loanId": "3", "newDueAt": "1797292800" }
],
"appliedLoans": ["1", "3"],
"noOp": false
}
}
{
"success": true,
"data": {
"txHash": "0x0ddbfbd173cec02dcd335720336ec72ced1e967714c36ae2bbf89e0871996267",
"functionName": "applyExtension",
"signedBy": "0x5ad87a0621175206b72d10e4b8577b192e7f40ab",
"activity": [],
"appliedLoans": [],
"noOp": true,
"outcome": "NO_LOAN_EXTENDED",
"notice": "The transaction mined but extended no loan: the market emitted no ExtensionApplied. Every loan in the page was either outside the batch (opened after the proposal was made), closed, or already at or past the proposal date, so no maturity moved. Propose a new extension for the loans that still need one."
}
}
{
"success": false,
"error": {
"code": "TX_WRONG_FUNCTION",
"message": "Transaction calls setConfig; expected proposeExtension or confirmExtension or applyExtension or cancelExtension or setAllowExtension"
}
}
