ui.toggleModal(null)}>
Create an account
diff --git a/frontend/src/components/SlackContent.js b/frontend/src/components/SlackContent.js
deleted file mode 100644
index af1912a2..00000000
--- a/frontend/src/components/SlackContent.js
+++ /dev/null
@@ -1,285 +0,0 @@
-
-import { jsx } from "@emotion/react";
-import { Link, Text, Image } from "@chakra-ui/react";
-const Topics = [
- {
- title: "Welcome!",
- body: [
- {
- text: [
-
- If you just installed Bugout, thank you for becoming a part of our
- community!
- ,
-
- @bugout turns your Slack workspace into a knowledge base.
- Keep reading to learn how.
- ,
- ],
- },
- ],
- },
- {
- title: "Contact us",
- body: [
- {
- text: [
-
- If you have any questions or would like to suggest improvements to
- Bugout, you can contact us by email: Neeraj -{" "}
-
- neeraj@bugout.dev
-
- , Sophia -{" "}
-
- sophia@bugout.dev
-
- .
- ,
- "You can also reach us on the Bugout community Slack channel. Direct message Neeraj (@zomglings) or Sophia (@Sophia).",
- ],
- },
- ],
- },
- {
- title: "Using @bugout",
- body: [
- {
- text: [
-
- The @bugout bot does not know about conversations in channels
- that it has not been invited to. To invite @bugout to a
- channel, simply mention it in that channel:
- ,
- ],
- },
- {
- image: {
- path: "/images/welcome/slack/image1.png",
- annotation: "Mention it in that channel and hit Enter.",
- },
- },
- {
- text: ["and hit Enter. You will see a prompt like this:"],
- },
- {
- image: {
- path: "/images/welcome/slack/image5.png",
- annotation: "Invite slack modal",
- },
- },
- {
- text: [
-
- Click “Invite to Channel”. Once you have successfully added{" "}
- @bugout to a channel, you will see a message like the one
- below:
- ,
- ],
- },
- {
- image: {
- path: "/images/welcome/slack/image2.png",
- annotation: "Invite slack modal",
- },
- },
- ],
- },
- {
- title: "Creating your team knowledge base",
- body: [
- {
- text: [
-
- You can work with your team knowledge base from the Bugout web app
- by going to{" "}
-
- https://bugout.dev
- {" "}
- and registering for an account using the “Register” button at the
- top right
- ,
- ],
- },
- {
- image: {
- path: "/images/welcome/slack/image9.png",
- annotation: "Bugout header",
- },
- },
- {
- text: [
- "Once you have a Bugout account, you can connect it to your Slack knowledge base by going back into Slack, starting a direct message with Bugout (under Apps):",
- ],
- },
- {
- image: {
- path: "/images/welcome/slack/image3.png",
- annotation: "slack bugout",
- },
- },
- {
- text: [
- "and typing:",
-
- @bugout admin authorize {``}
- ,
- ],
- },
- {
- image: {
- path: "/images/welcome/slack/image10.png",
- annotation: "authorize bugout",
- },
- },
- {
- text: ["If this is successful, you will see a thread like this:"],
- },
- {
- image: {
- path: "/images/welcome/slack/image13.png",
- annotation: "authorize bugout resopnse",
- },
- },
- {
- text: [
- "After this, you will see your team knowledge base under the “Journals” tab on the Bugout website.",
- ],
- },
- ],
- },
- {
- title: "Adding knowledge!",
- body: [
- {
- text: [
- "There are multiple ways of adding knowledge to your Bugout team knowledge base",
- ],
- },
- {
- title: "From the Bugout website",
- body: [
- {
- image: {
- path: "/images/welcome/slack/image7.gif",
- annotation: "website adding knowledge",
- },
- },
- ],
- },
- {
- title: "From Slack using the global shortcut",
- body: [
- {
- image: {
- path: "/images/welcome/slack/image8.gif",
- annotation: "slack adding knowledge",
- },
- },
- ],
- },
- {
- title: "From Slack using the bugout emoji",
- body: [
- {
- text: [
-
- If you have added the{" "}
-
- bugout emoji to your Slack workspace, you can react to messages
- with it to add them into your team’s knowledge base:
- ,
- ],
- },
- {
- image: {
- path: "/images/welcome/slack/image11.gif",
- annotation: "slack adding knowledge",
- },
- },
- ],
- },
- ],
- },
- {
- title: "Discovering knowledge",
- body: [
- {
- text: [
- "Any knowledge you add to your knowledge base is immediately accessible and discoverable to you, wherever you work.",
- ],
- },
- {
- title: "From the Bugout website",
- body: [
- {
- image: {
- path: "/images/welcome/slack/image6.png",
- annotation: "website knowledge",
- },
- },
- ],
- },
- {
- title: "From Slack using the global shortcut",
- body: [
- {
- image: {
- path: "/images/welcome/slack/image12.gif",
- annotation: "slack knowledge",
- },
- },
- ],
- },
- {
- title: "From Slack using @bugout",
- body: [
- {
- image: {
- path: "/images/welcome/slack/image4.gif",
- annotation: "slack command line knowledge",
- },
- },
- ],
- },
- ],
- },
- {
- title: "Installing Bugout",
- body: [
- {
- text: [
-
- Click here to install Bugout
- ,
-
- If you’d like to find out more, reach out to Neeraj{" "}
-
- neeraj@bugout.dev
- {" "}
- and Sophia -{" "}
-
- sophia@bugout.dev
-
- ,
- ],
- },
- ],
- },
-];
-export default Topics;
diff --git a/frontend/src/components/StreamEntry.js b/frontend/src/components/StreamEntry.js
new file mode 100644
index 00000000..cf3f7886
--- /dev/null
+++ b/frontend/src/components/StreamEntry.js
@@ -0,0 +1,107 @@
+import React, { useContext } from "react";
+import { Flex, Text, IconButton, Tag } from "@chakra-ui/react";
+import moment from "moment";
+import { ViewIcon } from "@chakra-ui/icons";
+import { useRouter } from "../core/hooks";
+import UIContext from "../core/providers/UIProvider/context";
+
+const StreamEntry = ({ entry, filterCallback, filterConstants }) => {
+ const ui = useContext(UIContext);
+ const router = useRouter();
+
+ const handleViewClicked = (entryId) => {
+ ui.setEntryId(entryId);
+ ui.setEntriesViewMode("entry");
+ router.push({
+ pathname: `/stream/${entry.id}`,
+ query: router.query,
+ });
+ };
+ return (
+
+
+
+ filterCallback({
+ direction: filterConstants.DIRECTIONS.SOURCE,
+ type: filterConstants.FILTER_TYPES.ADDRESS,
+ value: entry.from,
+ conditon: filterConstants.CONDITION.EQUAL,
+ })
+ }
+ >
+ {"From:"}
+ {`${entry.from_label} - ${entry.from.slice(
+ 0,
+ 5
+ )}...${entry.from.slice(-3, -1)}`}
+ {" "}
+
+ filterCallback({
+ direction: filterConstants.DIRECTIONS.DESTINATION,
+ type: filterConstants.FILTER_TYPES.ADDRESS,
+ value: entry.to,
+ conditon: filterConstants.CONDITION.EQUAL,
+ })
+ }
+ >
+ {"To:"}
+ {`${entry.to_label} - ${entry.to.slice(0, 5)}...${entry.to.slice(
+ -3,
+ -1
+ )}`}
+ {" "}
+
+ Gas Price: {entry.gasPrice}
+
+
+ Gas: {entry.gas}
+
+
+ Value: {entry.value}
+
+
+
+
+ {moment(entry.created_at).format("DD MMM, YYYY, h:mm:ss")}{" "}
+
+ }
+ onClick={() => handleViewClicked(entry.id)}
+ />
+
+ );
+};
+
+export default StreamEntry;
diff --git a/frontend/src/components/SubscriptionsList.js b/frontend/src/components/SubscriptionsList.js
index 3293724e..dee053fe 100644
--- a/frontend/src/components/SubscriptionsList.js
+++ b/frontend/src/components/SubscriptionsList.js
@@ -23,6 +23,7 @@ const List = (data) => {
useSubscriptions();
const updateCallback = ({ id, note }) => {
+ console.log("updateCallback", id);
changeNote.mutate({ id, note });
};
console.log(data);
@@ -44,9 +45,9 @@ const List = (data) => {
Token |
+ Label |
Address |
Date Created |
- label |
Actions |
@@ -78,10 +79,6 @@ const List = (data) => {
|
-
- {subscription.address}
- |
- {moment(subscription.created_at).format("L")} |
{
|
+
+ {subscription.address}
+ |
+ {moment(subscription.created_at).format("L")} |
+
{
- const { handleSubmit, errors, register } = useForm();
- const toast = useToast();
- const [verify, { isLoading, error, data }] = useMutation(async (data) => {
- const verificationResponse = await AuthService.verify(data);
- return verificationResponse.data;
- });
- const { getUser } = useUser();
-
- useEffect(() => {
- if (!data) {
- return;
- }
- getUser();
- toggleModal(null);
- }, [data, getUser, toggleModal]);
-
- useEffect(() => {
- if (error?.response?.data?.detail) {
- toast(error.response.data.detail, "error");
- }
- }, [error, toast]);
-
- return (
- toggleModal(null)}>
-
- Verify account
-
-
-
-
- We just sent you a verification code by email.
-
-
- Please enter the code here so we can verify that you are who you say you
- are.
-
-
- );
-};
-
-export default Verify;
diff --git a/frontend/src/core/hooks/useSignUp.js b/frontend/src/core/hooks/useSignUp.js
index 6b82fe57..f1212268 100644
--- a/frontend/src/core/hooks/useSignUp.js
+++ b/frontend/src/core/hooks/useSignUp.js
@@ -10,28 +10,31 @@ const useSignUp = (source) => {
const { inviteAccept } = useInviteAccept();
const analytics = useAnalytics();
- const [signUp, { isLoading, error, data }] = useMutation(
- AuthService.register(),
- {
- onSuccess: (response) => {
- localStorage.setItem("BUGOUT_ACCESS_TOKEN", response.data.access_token);
- const invite_code = window.sessionStorage.getItem("invite_code");
- if (invite_code) {
- inviteAccept(invite_code);
- }
+ const {
+ mutate: signUp,
+ isLoading,
+ error,
+ data,
+ isSuccess
+ } = useMutation(AuthService.register(), {
+ onSuccess: (response) => {
+ localStorage.setItem("BUGOUT_ACCESS_TOKEN", response.data.access_token);
+ const invite_code = window.sessionStorage.getItem("invite_code");
+ if (invite_code) {
+ inviteAccept(invite_code);
+ }
- if (analytics.isLoaded) {
- analytics.mixpanel.track(
- `${analytics.MIXPANEL_EVENTS.CONVERT_TO_USER}`,
- { full_url: router.nextRouter.asPath, code: source }
- );
- }
- },
- onError: (error) => {
- toast(error, "error");
- },
- }
- );
+ if (analytics.isLoaded) {
+ analytics.mixpanel.track(
+ `${analytics.MIXPANEL_EVENTS.CONVERT_TO_USER}`,
+ { full_url: router.nextRouter.asPath, code: source }
+ );
+ }
+ },
+ onError: (error) => {
+ toast(error, "error");
+ },
+ });
useEffect(() => {
if (!data) {
@@ -54,6 +57,7 @@ const useSignUp = (source) => {
isLoading,
data,
error,
+ isSuccess,
};
};
diff --git a/frontend/src/core/hooks/useStream.js b/frontend/src/core/hooks/useStream.js
new file mode 100644
index 00000000..6920f9b5
--- /dev/null
+++ b/frontend/src/core/hooks/useStream.js
@@ -0,0 +1,76 @@
+import { useInfiniteQuery } from "react-query";
+import { queryCacheProps } from "./hookCommon";
+import { SubscriptionsService } from "../services";
+
+const useJournalEntries = ({
+ refreshRate,
+ isContent,
+ pageSize,
+ searchQuery,
+ enabled,
+}) => {
+ const limit = pageSize ? pageSize : 25;
+
+ const getStream =
+ (searchTerm) =>
+ async ({ pageParam = 0 }) => {
+ if (!pageParam) {
+ pageParam = 0;
+ }
+
+ const searchTags = searchTerm.split(" ").filter(function (n) {
+ if (n.startsWith("#")) return n;
+ else {
+ return null;
+ }
+ });
+
+ const response = await SubscriptionsService.getStream({
+ searchTerm,
+ isContent,
+ limit,
+ offset: pageParam,
+ });
+ const newEntryList = response.data.stream.map((entry) => ({
+ ...entry,
+ }));
+ return {
+ data: [...newEntryList],
+ pageParams: {
+ pageParam: pageParam + 1,
+ next_offset: response.data.next_offset,
+ total_results: response.data.total_results,
+ offset: response.data.offset,
+ },
+ };
+ };
+
+ const {
+ data: EntriesPages,
+ isFetchingMore,
+ isLoading,
+ canFetchMore,
+ fetchMore,
+ refetch,
+ } = useInfiniteQuery(["stream", { searchQuery }], getStream(searchQuery), {
+ refetchInterval: refreshRate,
+ ...queryCacheProps,
+ getNextPageParam: (lastGroup) => {
+ return lastGroup.next_offset === null ? false : lastGroup.next_offset;
+ },
+ onSuccess: (data) => {
+ },
+ enabled: !!enabled,
+ });
+
+ return {
+ EntriesPages,
+ fetchMore,
+ isFetchingMore,
+ canFetchMore,
+ refetch,
+ isLoading,
+ };
+};
+
+export default useJournalEntries;
diff --git a/frontend/src/core/providers/UIProvider/index.js b/frontend/src/core/providers/UIProvider/index.js
index 0f3c84d8..f418f494 100644
--- a/frontend/src/core/providers/UIProvider/index.js
+++ b/frontend/src/core/providers/UIProvider/index.js
@@ -42,13 +42,13 @@ const UIProvider = ({ children }) => {
useEffect(() => {
if (isAppView && isAppReady && !user?.username && !isLoggingOut) {
- toggleModal("login");
+ // toggleModal("login");
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isAppView, isAppReady, user, isLoggingOut]);
useEffect(() => {
- if (isLoggingOut && !isAppView && !user) {
+ if (isLoggingOut && !isAppView && user) {
setLoggingOut(false);
}
}, [isAppView, user, isLoggingOut]);
@@ -90,7 +90,7 @@ const UIProvider = ({ children }) => {
const [sidebarCollapsed, setSidebarCollapsed] = useStorage(
window.sessionStorage,
"sidebarCollapsed",
- true
+ false
);
// Whether sidebar should be toggled in mobile view
diff --git a/frontend/src/core/services/subscriptions.service.js b/frontend/src/core/services/subscriptions.service.js
index 6987167b..755db3d6 100644
--- a/frontend/src/core/services/subscriptions.service.js
+++ b/frontend/src/core/services/subscriptions.service.js
@@ -4,17 +4,17 @@ import { http } from "../utils";
const API = process.env.NEXT_PUBLIC_MOONSTREAM_API_URL;
console.log(API);
-// export const getTypes = () =>
-// http({
-// method: "GET",
-// url: `${API}/subscription_types/`,
-// });
-
-// export const getSubscriptions = () =>
-// http({
-// method: "GET",
-// url: `${API}/subscriptions/`,
-// });
+export const getStream = ({ searchTerm, limit, offset, isContent }) =>
+ http({
+ method: "GET",
+ url: `${API}/stream`,
+ params: {
+ q: searchTerm,
+ limit: encodeURIComponent(limit),
+ offset: encodeURIComponent(offset),
+ content: encodeURIComponent(isContent),
+ },
+ });
export const getTypes = () =>
http({
@@ -65,7 +65,6 @@ export const createSubscription =
export const modifySubscription =
() =>
({ id, note }) => {
- console.log("modifySubscription: ", note, id);
const data = new FormData();
data.append("note", note);
data.append("id", id);
@@ -77,10 +76,9 @@ export const modifySubscription =
};
export const deleteSubscription = () => (id) => {
- console.log("deleteSubscription: ", id);
return http({
method: "DELETE",
- url: `${API}/subscription/${id}`,
+ url: `${API}/subscriptions/${id}`,
});
};
diff --git a/frontend/src/core/utils/mockupRequests.js b/frontend/src/core/utils/mockupRequests.js
index 75cf33cb..1b8985a7 100644
--- a/frontend/src/core/utils/mockupRequests.js
+++ b/frontend/src/core/utils/mockupRequests.js
@@ -12,6 +12,16 @@ const makeid = (length) => {
return result;
};
+const makenum = (length) => {
+ var result = "";
+ var characters = "0123456789";
+ var charactersLength = characters.length;
+ for (var i = 0; i < length; i++) {
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
+ }
+ return result;
+};
+
const randDate = () => {
return moment(
new Date(+new Date() - Math.floor(Math.random() * 10000000000))
@@ -19,35 +29,40 @@ const randDate = () => {
};
let MockSubscriptions = [
{
- address: makeid(24),
+ label: "Bobs wallet",
+ address: `0x` + makeid(24),
id: makeid(24),
notes: "lorem", //ToDo: rename in to label
created_at: randDate(),
subscription_type: "ethereum_blockchain",
},
{
- address: makeid(24),
+ label: "Alices wallet",
+ address: `0x` + makeid(40),
id: makeid(24),
notes: "lorem",
created_at: randDate(),
subscription_type: "ethereum_txpool",
},
{
- address: makeid(24),
+ label: "Alogrand Ricks Wallet",
+ address: `0x` + makeid(40),
id: makeid(24),
notes: "lorem",
created_at: randDate(),
subscription_type: "algorand_blockchain",
},
{
- address: makeid(24),
+ label: "Unknown wallet",
+ address: `0x` + makeid(40),
id: makeid(24),
notes: "lorem",
created_at: randDate(),
subscription_type: "ethereum_blockchain",
},
{
- address: makeid(24),
+ label: "Unknown wallet",
+ address: `0x` + makeid(40),
id: makeid(24),
notes: "lorem",
created_at: randDate(),
@@ -90,6 +105,136 @@ const enableMockupRequests = (axiosInstance) => {
],
});
+ mock.onGet(`${MOCK_API}/stream`).reply(200, {
+ stream: [
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ {
+ from_label: "Bobs wallet",
+ to_label: "Alices wallet",
+ to: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420AG",
+ from: "0x2E337E0Fb68F5e51ce9295E80BCd02273d7420c4",
+ gas: 2265656,
+ gasPrice: 1000000000,
+ hash: "0x5f0b6e212e55c7120f36fe6f88d46eb001c848064fd099116b42805bb3564ae6",
+ value: 0,
+ input:
+ "0x606061026b61014039602061026b60c03960c05160a01c1561002057600080fd5b61014051600055610160516001556001546101805181818301101561004457600080fd5b80820190509050600255600254421061005c57600080fd5b61025356600436101561000d576101ec565b600035601c52600051631998aeef8114156100855760015442101561003157600080fd5b600254421061003f57600080fd5b600454341161004d57600080fd5b600660035460e05260c052604060c020805460045481818301101561007157600080fd5b808201905090508155503360035534600455005b341561009057600080fd5b633ccfd60b8114156100db5760063360e05260c052604060c0205461014052600060063360e05260c052604060c02055600060006000600061014051336000f16100d957600080fd5b005b63fe67a54b811415610124576002544210156100f657600080fd5b6005541561010357600080fd5b600160055560006000600060006004546000546000f161012257600080fd5b005b6338af3eed81141561013c5760005460005260206000f35b634f245ef78114156101545760015460005260206000f35b632a24f46c81141561016c5760025460005260206000f35b6391f901578114156101845760035460005260206000f35b63d57bde7981141561019c5760045460005260206000f35b6312fa6feb8114156101b45760055460005260206000f35b6326b387bb8114156101ea5760043560a01c156101d057600080fd5b600660043560e05260c052604060c0205460005260206000f35b505b60006000fd5b61006161025303610061600039610061610253036000f30000000000000000000000002e337e0fb68f5e51ce9295e80bcd02273d7420c40000000000000000000000000000000000000000000000000000000060d2b04a00000000000000000000000000000000000000000000000000000000616b46ca",
+ },
+ ],
+ pageParams: {
+ next_offset: 25,
+ total_results: 4,
+ offset: 0,
+ },
+ });
+
// mock.onGet(`${MOCK_API}/subscriptions/`).reply(200, {
// data: {
// is_free_subscription_availible: true,
@@ -97,19 +242,20 @@ const enableMockupRequests = (axiosInstance) => {
// },
// });
- mock.onPost(`${MOCK_API}/subscriptions/`).reply((config) => {
- const params = config.data; // FormData of {name: ..., file: ...}
- const id = params.get("id");
- const note = params.get("note");
+ // mock.onPost(`${MOCK_API}/subscriptions/`).reply((config) => {
+ // const params = config.data; // FormData of {name: ..., file: ...}
+ // const id = params.get("id");
+ // const label = params.get("label");
+ // const address = params.get("address");
+ // const subscription_type = params.get("subscription_type");
- return new Promise(function (resolve) {
- setTimeout(function () {
- const data = { id, note };
- console.log("mock", id, note);
- MockSubscriptions.push({ ...data });
- resolve([200, { message: "OK", result: true }]);
- }, 1000);
- });
- });
+ // return new Promise(function (resolve) {
+ // setTimeout(function () {
+ // const data = { id, label, address, subscription_type };
+ // MockSubscriptions.push({ ...data });
+ // resolve([200, { message: "OK", result: true }]);
+ // }, 1000);
+ // });
+ // });
};
export default enableMockupRequests;
|