Add API calls for proposal and circuit
Add calls to the splinter API for proposals and circuits based on
circuit id.
@@ -38,6 +38,15 @@ export const listProposals = async () => {
throw Error(result.data);
};
+export const getProposal = async circuitId => {
+ const result = await get(`${splinterURL}/admin/proposals/${circuitId}`);
+
+ if (result.ok) {
+ return result.json;
+ }
+ throw Error(result.data);
+};
+
export const listCircuits = async () => {
const result = await get(`${splinterURL}/admin/circuits`);
@@ -47,6 +56,15 @@ export const listCircuits = async () => {
throw Error(result.data);
};
+export const getCircuit = async circuitId => {
+ const result = await get(`${splinterURL}/admin/circuits/${circuitId}`);
+
+ if (result.ok) {
+ return result.json;
+ }
+ throw Error(result.data);
+};
+
export const getNodeRegistry = async () => {
const result = await get(`${splinterURL}/registry/nodes`);
