Deployment
Nominate Candidate
Nominate a wallet to take a market lender-of-record role
POST
/
lending-external-securities-v2
/
api
/
markets
/
{marketId}
/
nominations
curl -X POST "https://api.trusset.org/lending-external-securities-v2/api/markets/{marketId}/nominations" \
-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`,
{
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": "nominateCurator",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64",
"signer": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52"
}
}
{
"success": false,
"error": {
"code": "DEPLOYER_NOT_AUTHORIZED",
"message": "Only the wallet that deployed this market (0x8cc2377924f1d6b6b0d6c5e0f97ee1f37c7bbf88) can nominate or withdraw a candidate on it, and it is not a verified wallet of this instance."
}
}
{
"success": false,
"error": {
"code": "ALREADY_NOMINATED",
"message": "This candidate is already nominated for this market"
}
}
Returns the factory transaction that nominates one more candidate for a market still seeking a lender of record. A nomination admits exactly one wallet: the candidate must later take the role with that address, through Accept Lender Role. See Lender of record.
Nominating is the deploying side’s act. The factory accepts the transaction only from the wallet that deployed this market, or from the factory owner, and the API applies the same rule before it builds anything: the market’s deployer, as the factory records it, has to be a verified wallet of this instance. Otherwise it answers
403 DEPLOYER_NOT_AUTHORIZED and names the deployer. A market the factory holds no deployer for can only be nominated on by the factory owner.
Sign with the wallet in signer, which is the wallet that deployed the market. There is no confirm call. Once the transaction mines, Get Nominations lists the candidate.
Path Parameters
string
required
Body Parameters
string
required
Wallet to nominate. A checksum-valid address that is not the zero address. Nominate the exact wallet the institution will sign the adoption with: a nomination names an address, not an institution.
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
nominateCurator.string
Market contract address, lowercased.
string
The nominated wallet, 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" \
-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`,
{
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": "nominateCurator",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64",
"signer": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52"
}
}
{
"success": false,
"error": {
"code": "DEPLOYER_NOT_AUTHORIZED",
"message": "Only the wallet that deployed this market (0x8cc2377924f1d6b6b0d6c5e0f97ee1f37c7bbf88) can nominate or withdraw a candidate on it, and it is not a verified wallet of this instance."
}
}
{
"success": false,
"error": {
"code": "ALREADY_NOMINATED",
"message": "This candidate is already 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 |
NOMINATE_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 |
ALREADY_NOMINATED | 409 | The candidate is already nominated on this market |
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 nomination |
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" \
-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`,
{
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": "nominateCurator",
"marketAddress": "0x70a0e25c7b768b87e658348b3b577678a173e038",
"candidate": "0xb27d0f6a91c458e307b2d4f8916ac05e73128b64",
"signer": "0x1234f9a07c6b53d81e2a4f70c9b385d6014a7e52"
}
}
{
"success": false,
"error": {
"code": "DEPLOYER_NOT_AUTHORIZED",
"message": "Only the wallet that deployed this market (0x8cc2377924f1d6b6b0d6c5e0f97ee1f37c7bbf88) can nominate or withdraw a candidate on it, and it is not a verified wallet of this instance."
}
}
{
"success": false,
"error": {
"code": "ALREADY_NOMINATED",
"message": "This candidate is already nominated for this market"
}
}
