const headers = { Authorization: MY_COMPANY_API_KEY };
const data = {
where: {},
data: {
fee: 100,
borrower: {
cardinal: {
amount: 100,
value: item.address,
publicKey: item.pubkey.toString("hex"),
},
},
expiry: moment().add(1, "d").format(),
},
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
data,
{ headers }
);
const headers = { Authorization: MY_COMPANY_API_KEY };
const data = {
where: { id: flow.id },
data: {
state: "broadcast-lock",
transactions,
},
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
data,
{ headers }
);
const headers = { Authorization: MY_COMPANY_API_KEY };
const data = {
where: { id: flow.id },
data: {
state: "unlock",
fee: 200,
index: 0,
},
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
data,
{ headers }
);
const headers = { Authorization: MY_COMPANY_API_KEY };
const data = {
where: { id: flow.id },
data: {
state: "broadcast-unlock",
transactions,
},
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
data,
{ headers }
);
The flow API uses these APIs under the hood:
- Create Escrow
- Execute Escrow
- Broadcast Escrow
- Collateral API
- Asset API
- Action API
- Create Outcomes and integration with the oracle
- Check one Outcome
- Execute signature
- Audit trails