Create an ARC Contract for a given Account ID using the API Key for that Account. The Account ID for the API Key used must be either the Borrower or Lender.
Gets a list of all the contracts your account is a counterparty to. An optional filter is available for showing only active or including inactive contracts.
Request format
method: 'GET'
endpoint: '/api/external/arc/contract?'
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'your api key' }
params: active=boolean (default is false to show all contracts)
To fund a contract, you can retrieve the Bitcoin Wallet Address for the Contract to deposit Bitcoin as collateral. You must be the Borrower in a Loan Contract to retrieve this.
While a contract has not been approved by either counterparty, either counterparty can update the contract terms and conditions. Any of the fields in the body below can be passed in. Only those passed will be updated. Some fields like fiatLoanValue, will impact other fields on the response such as fiatPrinciple which are calculations based on fiatLoanValue and collateralPercentage.
Each counterparty can set their withdrawal address for sending funds to an on-chain Bitcoin Wallet address. If this is not set, funds at settlement will be placed in the Lightning node's wallet. Funds can then be transferred at a later time. Recommendation is to set the withdrawal address so that funds are immediately transferred upon contract settlement
Request format
method: 'PUT'
endpoint: '/api/external/arc/contract/{contractId}/withdrawal-address'
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'your api key' }
body: {
"withdrawalAddress": "The Bitcoin wallet address to withdraw funds to at settlement"
}
Response format
{}
Approve a Contract
As a counterparty to a contract, you can choose to approve the terms and conditions.
{"counterparties": [ {"accountId":"Borrower Account ID","counterpartyType":"borrower" }, {"accountId":"Lender Account ID","counterpartyType":"lender" } ],"contractApprovals": [ {"contractId":"Contract ID","accountId":"The Account ID of who just approved","approvalTime": Timestamp of the approval } ]}