Skip to main content
POST
Returns the unsigned setDocument or removeDocument transaction for the document registry. The market admin’s wallet signs it in your environment, then you confirm it with Confirm Document. Trusset signs nothing and holds no key. The registry stores, per market and loan, a name, a locator and the document’s SHA-256, with the time it was last changed. Field names follow ERC-1643, the document standard of the security-token family. loanId 0 is the market itself; any other value must be a loan the market opened, open or closed. Recording a name that is already on record replaces it: the registry keeps one entry per name, and the event log keeps every earlier version provable.

Who can record

Only the wallet holding DEFAULT_ADMIN_ROLE on the market. The registry refuses everyone else with NotMarketAdmin, Trusset, the factory and the issuer included, and the right follows every admin handover. A market still seeking a lender of record has no admin, so nobody can record registry documents for it; its documents belong in its asset data, which the deploying wallet re-attests with Attest Asset Data. The signer must be one of your instance’s verified wallets. Name it with signerAddress, or leave it out and the first verified wallet holding the role signs. The builder checks the role and the loan on chain and simulates the call before it answers, so a write the registry would refuse is refused here before anyone signs.

Public and private

Choose one for every document. There is no default.
  • public: upload the file first with Upload Public Document and pass the uri it returned. The record must name a file this instance pinned under the same hash, so a locator the server cannot check against its hash is refused, an https address included.
  • private: pass the hash alone, with no uri. The file stays with the parties.
A loan document (loanId 1 or higher) names the borrower and the parties, so it is always private: public is refused with LOAN_DOCUMENT_MUST_BE_PRIVATE. Public is available for market documents (loanId 0) only. No body field may carry file content: a body with file, content, base64 or a similar field is refused with DOCUMENT_CONTENT_REFUSED.

Body Parameters

string
required
set to record or replace, remove to take a name off the record.
string
required
0 for the market, or the id of a loan the market opened.
string
required
1 to 31 lowercase letters, digits or hyphens, starting with a letter or digit. It is stored as bytes32. Suggested names: issuer-commitment, register-extract, board-resolution, shareholder-authorisation, issuance-terms, licence-position, legal-opinion, valuer-acceptance, loan-agreement, pledge-agreement.
string
Required with set: the SHA-256 of the exact file bytes, 64 hex characters, with or without 0x. The registry stores it as 0x followed by the 64 characters.
string
Required with set: public or private. Loan documents take private only.
string
With public only: the ipfs:// address the upload returned. At most 512 characters, no whitespace.
string
The admin wallet that will sign, when your instance has more than one.

Response Fields

object

Error Codes