import axios from "axios";
const headers = { };
const data = {
collateralizer: {
cardinal: {
amount: LOCK_AMOUNT,
value: COLLATERALIZER_BTC_ADDRESS,
publicKey: COLLATERALIZER_BTC_PUBLIC_KEY,
},
},
expiry: moment().add(1, "d").format(),
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
{ data },
{ headers }
);
import axios from "axios";
const headers = { };
const data = {
state: "broadcast-collateralize",
flow: {
flowEscrows: {
tag: "collateralize",
escrow: { transactions: [{base64: 'SIGNED_BASE_64'}] }
}
},
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
{ data },
{ headers }
);
import axios from "axios";
const headers = { };
const data = {
state: "uncollateralize",
amount: LOCK_AMOUNT,
index: INDEX_OF_THE_PATH_YOU_WOULD_LIKE_TO_UNLOCK,
};
const { data: escrow } = await axios.post(
`${DEEP_LAKE_REST_API_URL}/flows/execute`,
{ data },
{ headers }
);
import axios from "axios";
const headers = { };
const data = {
state: "broadcast-uncollateralize",
flow: {
flowEscrows: {
tag: "collateralize",
escrow: { transactions: [{base64: 'SIGNED_BASE_64'}] }
}
},
};
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