const res = await fetch( 'https://api.trusset.org/orderbooks/external-securities/api/custody-contract', { headers: { 'X-API-Key': 'trusset_your_key_here' } });const { data } = await res.json();if (!data.available) throw new Error('external securities custody is not deployed on this network');
Returns the TRexCustody address your instance settles through, resolved from the network your API key is bound to. There is one contract per network and it is the same for every issuer on that network.Ask for it rather than hardcoding it. The address differs between the test and production networks, and a book created against the wrong one is rejected with INVALID_CONFIG.available is false when no custody contract is deployed on your instance’s network yet. Creating a book on that network then returns 503 CUSTODY_NOT_DEPLOYED.generation says what the contract supports. Generation 2 adds allowance delivery, access gates and securities without an identity registry. Generation 2 is not deployed on any network yet, so every network answers 1 today. bookableFrameworks lists the token frameworks a new book can be created for. See Contract generations.
Response Fields
object
Show child attributes
string
The custody contract address, lower-cased, or null when none is deployed.
string
DEVELOPMENT or PRODUCTION, the network class your key resolves to.
boolean
Whether a contract address was resolved.
integer
1 or 2, read from the contract. null when none is deployed or the network did not answer.
array
The token frameworks a new book can be created for: ["erc3643"] on generation 1, and also erc1400, erc1404, erc7943 and erc20 on generation 2.
const res = await fetch( 'https://api.trusset.org/orderbooks/external-securities/api/custody-contract', { headers: { 'X-API-Key': 'trusset_your_key_here' } });const { data } = await res.json();if (!data.available) throw new Error('external securities custody is not deployed on this network');
const res = await fetch( 'https://api.trusset.org/orderbooks/external-securities/api/custody-contract', { headers: { 'X-API-Key': 'trusset_your_key_here' } });const { data } = await res.json();if (!data.available) throw new Error('external securities custody is not deployed on this network');