Deployment
Withdraw Nomination
Withdraw a candidate nomination from a market still seeking a lender of record
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
nominations
/
withdraw
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/nominations/withdraw" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64" }'
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/nominations/withdraw`,
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ candidate: '0xb27d0f6a91c458e307b2d4f8916ac05e73128b64' })
}
);
const { data } = await res.json();
const tx = await wallet.sendTransaction(data.transaction);
await tx.wait();
{
"success": true,
"data": {
"action": "SIGN_TRANSACTION",
"transaction": {
"to": "0xf1ad12f5698f58badd8a662acffccb067a2ddb8a",
"data": "0x...",
"value": "0",
"chainId": 11155111
},
"functionName": "withdrawNomination",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64",
"signer": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52"
}
}
{
"success": false,
"error": {
"code": "NOT_NOMINATED",
"message": "This candidate is not currently nominated for this market"
}
}
Returns the factory transaction that withdraws one candidate’s nomination. Once it mines, that wallet cannot take the market as a nominee, and Get Nominations stops listing it. Withdrawing is only possible while the market still seeks a lender of record: after adoption the nomination list is fixed.
A withdrawn wallet is not necessarily shut out. On a market deployed with
openToAnyCurator, it can still claim the role the way any claimant nobody nominated can, when the deployer’s borrower register verifies it. Nominating it again restores its nomination.
The same rule applies as for Nominate Candidate. The factory accepts the transaction only from the wallet that deployed this market, or from the factory owner, and the API builds it only when that deployer is a verified wallet of this instance. There is no confirm call.
Path Parameters
string
required
Body Parameters
string
required
Nominated wallet to withdraw. A checksum-valid address that is not the zero address. It must be nominated on this market right now.
Response Fields
object
Show child attributes
Show child attributes
string
SIGN_TRANSACTION.object
Unsigned transaction,
{ to, data, value, chainId }, addressed to the lending factory.string
withdrawNomination.string
Market contract address, lowercased.
string
The wallet whose nomination is withdrawn, lowercased.
string
The wallet that deployed the market, lowercased. The transaction has to be signed by it.
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/nominations/withdraw" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64" }'
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/nominations/withdraw`,
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ candidate: '0xb27d0f6a91c458e307b2d4f8916ac05e73128b64' })
}
);
const { data } = await res.json();
const tx = await wallet.sendTransaction(data.transaction);
await tx.wait();
{
"success": true,
"data": {
"action": "SIGN_TRANSACTION",
"transaction": {
"to": "0xf1ad12f5698f58badd8a662acffccb067a2ddb8a",
"data": "0x...",
"value": "0",
"chainId": 11155111
},
"functionName": "withdrawNomination",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64",
"signer": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52"
}
}
{
"success": false,
"error": {
"code": "NOT_NOMINATED",
"message": "This candidate is not currently nominated for this market"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
VALIDATION_ERROR | 400 | candidate is missing, malformed, the zero address, or fails its EIP-55 checksum |
NO_MARKET_ADDRESS | 400 | The market has no on-chain address |
WITHDRAW_NOMINATION_FAILED | 400 | The transaction could not be built for a reason that carries no code of its own |
MISSING_MARKET_ID | 400 | marketId is longer than 100 characters |
DEPLOYER_NOT_AUTHORIZED | 403 | The wallet that deployed this market is not a verified wallet of this instance. On a market the factory holds no deployer for, no wallet of this instance is the factory owner |
MARKET_NOT_FOUND | 404 | No market with this ID on your instance |
MARKET_NOT_DEPLOYED | 404 | The lending factory holds no deployment for this market |
NOT_NOMINATED | 409 | The candidate is not nominated on this market right now |
NOT_SEEKING_CURATOR | 409 | The market already has a lender of record. The message names it |
WALLET_NOT_CONFIGURED | 412 | This instance has no verified wallet to sign the withdrawal |
FACTORY_READ_FAILED | 503 | The factory could not be reached to read the market or its deployer. Retry shortly |
⌘I
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/nominations/withdraw" \
-H "X-API-Key: trusset_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64" }'
const res = await fetch(
`https://api.trusset.org/lending-external-securities-v2/api/markets/${marketId}/nominations/withdraw`,
{
method: 'POST',
headers: {
'X-API-Key': 'trusset_your_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ candidate: '0xb27d0f6a91c458e307b2d4f8916ac05e73128b64' })
}
);
const { data } = await res.json();
const tx = await wallet.sendTransaction(data.transaction);
await tx.wait();
{
"success": true,
"data": {
"action": "SIGN_TRANSACTION",
"transaction": {
"to": "0xf1ad12f5698f58badd8a662acffccb067a2ddb8a",
"data": "0x...",
"value": "0",
"chainId": 11155111
},
"functionName": "withdrawNomination",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64",
"signer": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52"
}
}
{
"success": false,
"error": {
"code": "NOT_NOMINATED",
"message": "This candidate is not currently nominated for this market"
}
}
