diff --git a/.gitignore b/.gitignore index afa2cf9e..80053b3d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # dependencies /node_modules +*/**/node_modules /.pnp .pnp.js @@ -10,6 +11,8 @@ # production /build +*/**/dist +*/**/build # distributions /dist @@ -18,10 +21,11 @@ # misc .DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local +/packages/*/.env +/packages/*/.env.local +/packages/*/.env.development.local +/packages/*/.env.test.local +/packages/*/.env.production.local npm-debug.log* yarn-debug.log* diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 82f573b9..00000000 --- a/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM ubuntu:20.04 as build - -MAINTAINER SDF Ops Team - -RUN mkdir -p /app -RUN apt-get update && apt-get install -y gnupg1 - -WORKDIR /app - -ARG REACT_APP_AMPLITUDE_KEY - -ENV REACT_APP_AMPLITUDE_KEY $REACT_APP_AMPLITUDE_KEY - -ARG REACT_APP_SENTRY_KEY - -ENV REACT_APP_SENTRY_KEY $REACT_APP_SENTRY_KEY - -RUN apt-get update && apt-get install -y gnupg curl git make apt-transport-https && \ - curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \ - echo "deb https://deb.nodesource.com/node_14.x focal main" | tee /etc/apt/sources.list.d/nodesource.list && \ - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ - apt-get update && apt-get install -y nodejs yarn && apt-get clean - - -COPY . /app/ -RUN yarn install -RUN yarn build - -FROM nginx:1.17 - -COPY --from=build /app/build/ /usr/share/nginx/html/ -COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/Dockerfile-client b/Dockerfile-client new file mode 100644 index 00000000..0fb1aacd --- /dev/null +++ b/Dockerfile-client @@ -0,0 +1,21 @@ +FROM node:16 as build + +MAINTAINER SDF Ops Team + +WORKDIR /app + +ARG REACT_APP_CLIENT_DOMAIN +ENV REACT_APP_CLIENT_DOMAIN $REACT_APP_CLIENT_DOMAIN + +ARG REACT_APP_WALLET_BACKEND_ENDPOINT +ENV REACT_APP_WALLET_BACKEND_ENDPOINT $REACT_APP_WALLET_BACKEND_ENDPOINT + +COPY . /app/ +RUN yarn workspace demo-wallet-client install +RUN yarn build:shared +RUN yarn build:client + +# Copy the compiled static files out to an Nginx container, since we don't need any of the Node files. +FROM nginx:1.17 +COPY --from=build /app/packages/demo-wallet-client/build/ /usr/share/nginx/html/ +COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/Dockerfile-server b/Dockerfile-server new file mode 100644 index 00000000..6ba79b2c --- /dev/null +++ b/Dockerfile-server @@ -0,0 +1,17 @@ +FROM node:16 as build + +MAINTAINER SDF Ops Team + +WORKDIR /app + +COPY . /app/ +RUN yarn workspace demo-wallet-server install +RUN yarn build:shared +RUN yarn build:server + +# Copy it all to a clean image to avoid cache artifacts elsewhere in the image +FROM node:16 +COPY --from=build /app /app +WORKDIR /app + +CMD ["yarn", "start:server"] diff --git a/Makefile b/Makefile index 6379ed56..0ff809a4 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,22 @@ SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo") # If LABEL is not provided set default value LABEL ?= $(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n)) # If TAG is not provided set default value -TAG ?= stellar/stellar-demo-wallet:$(LABEL) +SERVER_TAG ?= stellar/stellar-demo-wallet-server:$(LABEL) +CLIENT_TAG ?= stellar/stellar-demo-wallet-client:$(LABEL) # https://github.com/opencontainers/image-spec/blob/master/annotations.md BUILD_DATE := $(shell date -u +%FT%TZ) -docker-build: - $(SUDO) docker build --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \ - --build-arg REACT_APP_AMPLITUDE_KEY=$(AMPLITUDE_KEY) --build-arg REACT_APP_SENTRY_KEY=$(SENTRY_KEY) -t $(TAG) . +docker-build-server: + $(SUDO) docker build -f Dockerfile-server --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \ + -t $(SERVER_TAG) . -docker-push: - $(SUDO) docker push $(TAG) +docker-push-server: + $(SUDO) docker push $(SERVER_TAG) + +docker-build-client: + $(SUDO) docker build -f Dockerfile-client --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \ + --build-arg REACT_APP_CLIENT_DOMAIN=$(REACT_APP_CLIENT_DOMAIN) --build-arg REACT_APP_WALLET_BACKEND_ENDPOINT=$(REACT_APP_WALLET_BACKEND_ENDPOINT) \ + -t $(CLIENT_TAG) . + +docker-push-client: + $(SUDO) docker push $(CLIENT_TAG) diff --git a/README.md b/README.md index bdd92f27..8ab2f29b 100644 --- a/README.md +++ b/README.md @@ -107,16 +107,28 @@ To start building with this project clone this repo and install the deps: yarn install ``` +create a **.env** file in *packages/demo-wallet-client* with the **REACT_APP_CLIENT_DOMAIN** +(where stellar.toml is hosted) and the wallet backend **REACT_APP_WALLET_BACKEND_ENDPOINT** + +NOTE: if using a locally running test anchor (in docker) use *docker.for.mac.host.internal*, +this will allow the anchor that's running in a docker container to access the host network where +the client domain (server hosting the stellar.toml) is running. +ex: +``` +REACT_APP_CLIENT_DOMAIN = docker.for.mac.host.internal:7000 +REACT_APP_WALLET_BACKEND_ENDPOINT = http://demo-wallet-server.stellar.org +``` + and run: ```bash -yarn start +yarn start:client ``` To build the app for production, run: ```bash -yarn build +yarn build:client ``` --- diff --git a/package.json b/package.json index abaeecda..aa07c3d2 100644 --- a/package.json +++ b/package.json @@ -1,108 +1,21 @@ { - "name": "stellar-demo-wallet", - "version": "1.2.4", - "description": "Stellar Demo Wallet", - "repository": "https://github.com/stellar/stellar-demo-wallet", - "license": "Apache-2.0", - "engines": { - "node": "14.x" - }, - "lint-staged": { - "src/**/*.ts?(x)": [ - "eslint --fix --max-warnings 0" - ] - }, - "dependencies": { - "@reduxjs/toolkit": "^1.6.2", - "@stellar/design-system": "^0.4.1", - "@stellar/frontend-helpers": "^2.1.3", - "@stellar/prettier-config": "^1.0.1", - "@stellar/wallet-sdk": "^0.5.0-rc.0", - "@testing-library/jest-dom": "^5.14.1", - "@testing-library/react": "^12.1.2", - "@testing-library/user-event": "^13.2.1", - "bignumber.js": "^9.0.1", - "crypto": "^1.0.1", - "dompurify": "^2.3.3", - "html-react-parser": "^1.4.0", - "lodash": "^4.17.21", - "marked": "^3.0.4", - "node-sass": "^6.0.1", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-json-view": "^1.21.3", - "react-redux": "^7.2.5", - "react-router-dom": "^5.3.0", - "react-scripts": "4.0.3", - "redux": "^4.1.1", - "stellar-sdk": "^9.0.0-beta.1", - "styled-components": "^5.3.1", - "toml": "^3.0.0", - "tslib": "^2.3.1", - "typescript": "~4.4.3", - "web-vitals": "^2.1.0" - }, + "private": true, + "workspaces": [ + "packages/*" + ], "scripts": { - "install-if-package-changed": "git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet yarn.lock && yarn install || exit 0", - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "prod:build": "docker image build --build-arg REACT_APP_AMPLITUDE_KEY=$AMPLITUDE_KEY --build-arg REACT_APP_SENTRY_KEY=$SENTRY_KEY -t stellar-demo-wallet:localbuild .", - "prod:serve": "docker run -p 8000:80 stellar-demo-wallet:localbuild", - "production": "yarn prod:build && yarn prod:serve", - "prepare": "husky install", - "pre-commit": "concurrently 'pretty-quick --staged' 'lint-staged' 'tsc --noEmit'" + "build:client": "yarn workspace demo-wallet-client build", + "build:shared": "yarn workspace demo-wallet-shared build", + "build:server": "yarn workspace demo-wallet-server build", + "build": "run-s build:shared build:client", + "start:client": "yarn workspace demo-wallet-client start", + "start:shared": "yarn workspace demo-wallet-shared start", + "start:server": "yarn workspace demo-wallet-server start", + "clean": "rm -rf node_modules && rm -rf */**/node_modules && rm -rf */**/build" }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@stellar/eslint-config": "^2.1.1", - "@stellar/tsconfig": "^1.0.2", - "@types/jest": "^27.0.2", - "@types/lodash": "^4.14.175", - "@types/marked": "^3.0.1", - "@types/node": "^16.10.3", - "@types/react": "^17.0.27", - "@types/react-copy-to-clipboard": "^5.0.1", - "@types/react-dom": "^17.0.9", - "@types/react-redux": "^7.1.18", - "@types/react-router-dom": "^5.1.9", - "@types/redux": "^3.6.0", - "@types/styled-components": "^5.1.14", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", - "concurrently": "^6.3.0", - "eslint": "^7.32.0", - "eslint-config-prettier": "^8.3.0", - "eslint-config-react": "^1.1.7", - "eslint-config-react-app": "^6.0.0", - "eslint-plugin-flowtype": "^6.1.0", - "eslint-plugin-import": "^2.24.2", - "eslint-plugin-jsdoc": "^36.1.0", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-react": "^7.26.1", - "eslint-plugin-react-hooks": "^4.2.0", - "husky": "^7.0.2", - "lint-staged": "^11.2.0", - "prettier": "^2.4.1", - "pretty-quick": "^3.1.1" + "dependencies": { + "demo-wallet-shared": "^1.0.0", + "npm-run-all": "^4.1.5", + "stellar-sdk": "^9.1.0" } } diff --git a/architecture.md b/packages/demo-wallet-client/architecture.md similarity index 100% rename from architecture.md rename to packages/demo-wallet-client/architecture.md diff --git a/packages/demo-wallet-client/package.json b/packages/demo-wallet-client/package.json new file mode 100644 index 00000000..66512d80 --- /dev/null +++ b/packages/demo-wallet-client/package.json @@ -0,0 +1,111 @@ +{ + "name": "demo-wallet-client", + "version": "1.2.4", + "description": "Stellar Demo Wallet client", + "repository": { + "type": "git", + "url": "https://github.com/stellar/stellar-demo-wallet.git", + "directory": "packages/demo-wallet-client" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=14.x" + }, + "lint-staged": { + "src/**/*.ts?(x)": [ + "eslint --fix --max-warnings 0" + ] + }, + "dependencies": { + "@reduxjs/toolkit": "^1.6.2", + "@stellar/design-system": "^0.4.1", + "@stellar/frontend-helpers": "^2.1.3", + "@stellar/prettier-config": "^1.0.1", + "@stellar/wallet-sdk": "^0.5.0-rc.0", + "@testing-library/jest-dom": "^5.14.1", + "@testing-library/react": "^12.1.2", + "@testing-library/user-event": "^13.2.1", + "bignumber.js": "^9.0.1", + "crypto": "^1.0.1", + "dompurify": "^2.3.3", + "env-cmd": "^10.1.0", + "find-config": "^1.0.0", + "html-react-parser": "^1.4.0", + "lodash": "^4.17.21", + "marked": "^3.0.4", + "node-sass": "^6.0.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-json-view": "^1.21.3", + "react-redux": "^7.2.5", + "react-router-dom": "^5.3.0", + "react-scripts": "4.0.3", + "redux": "^4.1.1", + "stellar-sdk": "^9.1.0", + "styled-components": "^5.3.1", + "toml": "^3.0.0", + "tslib": "^2.3.1", + "typescript": "~4.4.3", + "web-vitals": "^2.1.0" + }, + "scripts": { + "install-if-package-changed": "git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet yarn.lock && yarn install || exit 0", + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "prepare": "cd ../../ && husky install packages/demo-wallet-client/.husky", + "pre-commit": "concurrently 'pretty-quick --staged' 'lint-staged' 'tsc --noEmit'" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@stellar/eslint-config": "^2.1.1", + "@stellar/tsconfig": "^1.0.2", + "@types/jest": "^27.0.2", + "@types/lodash": "^4.14.175", + "@types/marked": "^3.0.1", + "@types/node": "^16.10.3", + "@types/react": "^17.0.27", + "@types/react-copy-to-clipboard": "^5.0.1", + "@types/react-dom": "^17.0.9", + "@types/react-redux": "^7.1.18", + "@types/react-router-dom": "^5.1.9", + "@types/redux": "^3.6.0", + "@types/styled-components": "^5.1.14", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", + "concurrently": "^6.3.0", + "eslint": "^7.32.0", + "eslint-config-prettier": "^8.3.0", + "eslint-config-react": "^1.1.7", + "eslint-config-react-app": "^6.0.0", + "eslint-plugin-flowtype": "^6.1.0", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-jsdoc": "^36.1.0", + "eslint-plugin-jsx-a11y": "^6.4.1", + "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-react": "^7.26.1", + "eslint-plugin-react-hooks": "^4.2.0", + "husky": "^7.0.2", + "lint-staged": "^11.2.0", + "prettier": "^2.4.1", + "pretty-quick": "^3.1.1" + } +} diff --git a/public/favicon.ico b/packages/demo-wallet-client/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to packages/demo-wallet-client/public/favicon.ico diff --git a/public/images/doc-redux-state.png b/packages/demo-wallet-client/public/images/doc-redux-state.png similarity index 100% rename from public/images/doc-redux-state.png rename to packages/demo-wallet-client/public/images/doc-redux-state.png diff --git a/public/index.html b/packages/demo-wallet-client/public/index.html similarity index 100% rename from public/index.html rename to packages/demo-wallet-client/public/index.html diff --git a/public/logo192.png b/packages/demo-wallet-client/public/logo192.png similarity index 100% rename from public/logo192.png rename to packages/demo-wallet-client/public/logo192.png diff --git a/public/logo512.png b/packages/demo-wallet-client/public/logo512.png similarity index 100% rename from public/logo512.png rename to packages/demo-wallet-client/public/logo512.png diff --git a/public/manifest.json b/packages/demo-wallet-client/public/manifest.json similarity index 100% rename from public/manifest.json rename to packages/demo-wallet-client/public/manifest.json diff --git a/public/robots.txt b/packages/demo-wallet-client/public/robots.txt similarity index 100% rename from public/robots.txt rename to packages/demo-wallet-client/public/robots.txt diff --git a/public/settings/env-config.js b/packages/demo-wallet-client/public/settings/env-config.js similarity index 100% rename from public/settings/env-config.js rename to packages/demo-wallet-client/public/settings/env-config.js diff --git a/src/App.scss b/packages/demo-wallet-client/src/App.scss similarity index 100% rename from src/App.scss rename to packages/demo-wallet-client/src/App.scss diff --git a/src/App.tsx b/packages/demo-wallet-client/src/App.tsx similarity index 100% rename from src/App.tsx rename to packages/demo-wallet-client/src/App.tsx diff --git a/src/components/AccountInfo.tsx b/packages/demo-wallet-client/src/components/AccountInfo.tsx similarity index 98% rename from src/components/AccountInfo.tsx rename to packages/demo-wallet-client/src/components/AccountInfo.tsx index 90ccf155..02726a10 100644 --- a/src/components/AccountInfo.tsx +++ b/packages/demo-wallet-client/src/components/AccountInfo.tsx @@ -15,7 +15,7 @@ import { ToastBanner } from "components/ToastBanner"; import { fetchAccountAction, fundTestnetAccount } from "ducks/account"; import { fetchClaimableBalancesAction } from "ducks/claimableBalances"; -import { shortenStellarKey } from "helpers/shortenStellarKey"; +import { shortenStellarKey } from "demo-wallet-shared/build/helpers/shortenStellarKey"; import { useRedux } from "hooks/useRedux"; import { ActionStatus } from "types/types.d"; diff --git a/src/components/AddAsset.tsx b/packages/demo-wallet-client/src/components/AddAsset.tsx similarity index 93% rename from src/components/AddAsset.tsx rename to packages/demo-wallet-client/src/components/AddAsset.tsx index f4c4107d..fc58d3d7 100644 --- a/src/components/AddAsset.tsx +++ b/packages/demo-wallet-client/src/components/AddAsset.tsx @@ -8,11 +8,11 @@ import { Input, DetailsTooltip, } from "@stellar/design-system"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { getValidatedUntrustedAsset } from "helpers/getValidatedUntrustedAsset"; -import { searchParam } from "helpers/searchParam"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { getValidatedUntrustedAsset } from "demo-wallet-shared/build/helpers/getValidatedUntrustedAsset"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, SearchParams } from "types/types.d"; diff --git a/src/components/AddPresetAsset.tsx b/packages/demo-wallet-client/src/components/AddPresetAsset.tsx similarity index 89% rename from src/components/AddPresetAsset.tsx rename to packages/demo-wallet-client/src/components/AddPresetAsset.tsx index b7682c4b..b3a2b9b9 100644 --- a/src/components/AddPresetAsset.tsx +++ b/packages/demo-wallet-client/src/components/AddPresetAsset.tsx @@ -7,15 +7,15 @@ import { TextLink, Modal, } from "@stellar/design-system"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { getPresetAssets } from "helpers/getPresetAssets"; -import { getValidatedUntrustedAsset } from "helpers/getValidatedUntrustedAsset"; -import { log } from "helpers/log"; -import { searchParam } from "helpers/searchParam"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { getPresetAssets } from "demo-wallet-shared/build/helpers/getPresetAssets"; +import { getValidatedUntrustedAsset } from "demo-wallet-shared/build/helpers/getValidatedUntrustedAsset"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, presetAsset, SearchParams } from "types/types.d"; -import { shortenStellarKey } from "helpers/shortenStellarKey"; +import { shortenStellarKey } from "demo-wallet-shared/build/helpers/shortenStellarKey"; export const AddPresetAsset = ({ onClose }: { onClose: () => void }) => { const { account, allAssets, settings, untrustedAssets } = useRedux( diff --git a/src/components/Assets.tsx b/packages/demo-wallet-client/src/components/Assets.tsx similarity index 98% rename from src/components/Assets.tsx rename to packages/demo-wallet-client/src/components/Assets.tsx index 9cd65ec5..03b652f8 100644 --- a/src/components/Assets.tsx +++ b/packages/demo-wallet-client/src/components/Assets.tsx @@ -17,7 +17,7 @@ import { ClaimableBalance } from "components/ClaimableBalance"; import { ConfirmAssetAction } from "components/ConfirmAssetAction"; import { ToastBanner } from "components/ToastBanner"; import { UntrustedBalance } from "components/UntrustedBalance"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { fetchAccountAction, resetAccountStatusAction } from "ducks/account"; import { @@ -43,8 +43,8 @@ import { } from "ducks/untrustedAssets"; import { resetSep24WithdrawAssetAction } from "ducks/sep24WithdrawAsset"; -import { getPresetAssets } from "helpers/getPresetAssets"; -import { searchParam } from "helpers/searchParam"; +import { getPresetAssets } from "demo-wallet-shared/build/helpers/getPresetAssets"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { Asset, diff --git a/src/components/Balance.tsx b/packages/demo-wallet-client/src/components/Balance.tsx similarity index 100% rename from src/components/Balance.tsx rename to packages/demo-wallet-client/src/components/Balance.tsx diff --git a/src/components/BalanceRow.tsx b/packages/demo-wallet-client/src/components/BalanceRow.tsx similarity index 98% rename from src/components/BalanceRow.tsx rename to packages/demo-wallet-client/src/components/BalanceRow.tsx index c4ea0f67..39588430 100644 --- a/src/components/BalanceRow.tsx +++ b/packages/demo-wallet-client/src/components/BalanceRow.tsx @@ -1,7 +1,7 @@ import React, { ReactNode, useEffect, useState } from "react"; import { Select, TextLink, DetailsTooltip } from "@stellar/design-system"; import { HomeDomainOverrideButtons } from "components/HomeDomainOverrideButtons"; -import { shortenStellarKey } from "helpers/shortenStellarKey"; +import { shortenStellarKey } from "demo-wallet-shared/build/helpers/shortenStellarKey"; import { Asset, ActiveAssetAction, diff --git a/src/components/ClaimableBalance.tsx b/packages/demo-wallet-client/src/components/ClaimableBalance.tsx similarity index 100% rename from src/components/ClaimableBalance.tsx rename to packages/demo-wallet-client/src/components/ClaimableBalance.tsx diff --git a/src/components/ConfigurationModal.tsx b/packages/demo-wallet-client/src/components/ConfigurationModal.tsx similarity index 93% rename from src/components/ConfigurationModal.tsx rename to packages/demo-wallet-client/src/components/ConfigurationModal.tsx index 77363a8b..7f781ad5 100644 --- a/src/components/ConfigurationModal.tsx +++ b/packages/demo-wallet-client/src/components/ConfigurationModal.tsx @@ -1,6 +1,6 @@ import { useHistory } from "react-router-dom"; import { Button, Modal, Toggle } from "@stellar/design-system"; -import { searchParam } from "helpers/searchParam"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { SearchParams } from "types/types.d"; diff --git a/src/components/ConfirmAssetAction.tsx b/packages/demo-wallet-client/src/components/ConfirmAssetAction.tsx similarity index 100% rename from src/components/ConfirmAssetAction.tsx rename to packages/demo-wallet-client/src/components/ConfirmAssetAction.tsx diff --git a/src/components/ConnectAccount.tsx b/packages/demo-wallet-client/src/components/ConnectAccount.tsx similarity index 95% rename from src/components/ConnectAccount.tsx rename to packages/demo-wallet-client/src/components/ConnectAccount.tsx index 53bb0770..afe1d3a2 100644 --- a/src/components/ConnectAccount.tsx +++ b/packages/demo-wallet-client/src/components/ConnectAccount.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { Button, Checkbox, Input, Modal } from "@stellar/design-system"; import { useHistory } from "react-router-dom"; -import { searchParam } from "helpers/searchParam"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, SearchParams } from "types/types.d"; diff --git a/src/components/ErrorMessage/index.tsx b/packages/demo-wallet-client/src/components/ErrorMessage/index.tsx similarity index 100% rename from src/components/ErrorMessage/index.tsx rename to packages/demo-wallet-client/src/components/ErrorMessage/index.tsx diff --git a/src/components/ErrorMessage/styles.scss b/packages/demo-wallet-client/src/components/ErrorMessage/styles.scss similarity index 100% rename from src/components/ErrorMessage/styles.scss rename to packages/demo-wallet-client/src/components/ErrorMessage/styles.scss diff --git a/src/components/Footer.tsx b/packages/demo-wallet-client/src/components/Footer.tsx similarity index 92% rename from src/components/Footer.tsx rename to packages/demo-wallet-client/src/components/Footer.tsx index 9688067f..4bfb489f 100644 --- a/src/components/Footer.tsx +++ b/packages/demo-wallet-client/src/components/Footer.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { TextLink, Layout, Modal } from "@stellar/design-system"; import { ConfigurationModal } from "components/ConfigurationModal"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { useRedux } from "hooks/useRedux"; export const Footer = () => { diff --git a/src/components/Header.tsx b/packages/demo-wallet-client/src/components/Header.tsx similarity index 90% rename from src/components/Header.tsx rename to packages/demo-wallet-client/src/components/Header.tsx index b2270c08..44210bc2 100644 --- a/src/components/Header.tsx +++ b/packages/demo-wallet-client/src/components/Header.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import { Layout, Modal } from "@stellar/design-system"; import { SignOutModal } from "components/SignOutModal"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { useRedux } from "hooks/useRedux"; export const Header = () => { diff --git a/src/components/HomeDomainOverrideButtons.tsx b/packages/demo-wallet-client/src/components/HomeDomainOverrideButtons.tsx similarity index 94% rename from src/components/HomeDomainOverrideButtons.tsx rename to packages/demo-wallet-client/src/components/HomeDomainOverrideButtons.tsx index 85b92d2e..11d249ce 100644 --- a/src/components/HomeDomainOverrideButtons.tsx +++ b/packages/demo-wallet-client/src/components/HomeDomainOverrideButtons.tsx @@ -11,13 +11,13 @@ import { import { ConfirmAssetAction } from "components/ConfirmAssetAction"; import { HomeDomainOverrideModal } from "components/HomeDomainOverrideModal"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { setActiveAssetAction, resetActiveAssetAction, } from "ducks/activeAsset"; -import { log } from "helpers/log"; -import { searchParam } from "helpers/searchParam"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { ActionStatus, Asset, SearchParams } from "types/types.d"; import { useRedux } from "hooks/useRedux"; diff --git a/src/components/HomeDomainOverrideModal.tsx b/packages/demo-wallet-client/src/components/HomeDomainOverrideModal.tsx similarity index 86% rename from src/components/HomeDomainOverrideModal.tsx rename to packages/demo-wallet-client/src/components/HomeDomainOverrideModal.tsx index 4f7b1d09..ded0fc0b 100644 --- a/src/components/HomeDomainOverrideModal.tsx +++ b/packages/demo-wallet-client/src/components/HomeDomainOverrideModal.tsx @@ -1,11 +1,11 @@ import { useState } from "react"; import { useHistory } from "react-router-dom"; import { Button, Input, InfoBlock, Modal } from "@stellar/design-system"; -import { getAssetFromHomeDomain } from "helpers/getAssetFromHomeDomain"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { searchParam } from "helpers/searchParam"; +import { getAssetFromHomeDomain } from "demo-wallet-shared/build/helpers/getAssetFromHomeDomain"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { Asset, SearchParams } from "types/types.d"; diff --git a/src/components/Json.tsx b/packages/demo-wallet-client/src/components/Json.tsx similarity index 100% rename from src/components/Json.tsx rename to packages/demo-wallet-client/src/components/Json.tsx diff --git a/src/components/LogItem/index.tsx b/packages/demo-wallet-client/src/components/LogItem/index.tsx similarity index 97% rename from src/components/LogItem/index.tsx rename to packages/demo-wallet-client/src/components/LogItem/index.tsx index 291d9aab..7ede4ea2 100644 --- a/src/components/LogItem/index.tsx +++ b/packages/demo-wallet-client/src/components/LogItem/index.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; import marked from "marked"; import { Icon } from "@stellar/design-system"; import { Json } from "components/Json"; -import { sanitizeHtml } from "helpers/sanitizeHtml"; +import { sanitizeHtml } from "demo-wallet-shared/build/helpers/sanitizeHtml"; import { LogType, AnyObject } from "types/types.d"; import "./styles.scss"; diff --git a/src/components/LogItem/styles.scss b/packages/demo-wallet-client/src/components/LogItem/styles.scss similarity index 100% rename from src/components/LogItem/styles.scss rename to packages/demo-wallet-client/src/components/LogItem/styles.scss diff --git a/src/components/Logs.tsx b/packages/demo-wallet-client/src/components/Logs.tsx similarity index 97% rename from src/components/Logs.tsx rename to packages/demo-wallet-client/src/components/Logs.tsx index 8374e9b3..df7548f9 100644 --- a/src/components/Logs.tsx +++ b/packages/demo-wallet-client/src/components/Logs.tsx @@ -3,7 +3,7 @@ import { useDispatch } from "react-redux"; import { Layout, TextLink } from "@stellar/design-system"; import { LogItem } from "components/LogItem"; -import { LOG_MESSAGE_EVENT } from "constants/settings"; +import { LOG_MESSAGE_EVENT } from "demo-wallet-shared/build/constants/settings"; import { clearLogsAction, addLogAction } from "ducks/logs"; import { useRedux } from "hooks/useRedux"; import { LogItemProps } from "types/types.d"; diff --git a/src/components/PrivateRoute.tsx b/packages/demo-wallet-client/src/components/PrivateRoute.tsx similarity index 100% rename from src/components/PrivateRoute.tsx rename to packages/demo-wallet-client/src/components/PrivateRoute.tsx diff --git a/src/components/SendPayment.tsx b/packages/demo-wallet-client/src/components/SendPayment.tsx similarity index 98% rename from src/components/SendPayment.tsx rename to packages/demo-wallet-client/src/components/SendPayment.tsx index 3d16eab6..1f68ab16 100644 --- a/src/components/SendPayment.tsx +++ b/packages/demo-wallet-client/src/components/SendPayment.tsx @@ -14,7 +14,7 @@ import { ErrorMessage } from "components/ErrorMessage"; import { fetchAccountAction } from "ducks/account"; import { resetActiveAssetAction } from "ducks/activeAsset"; import { sendPaymentAction, resetSendPaymentAction } from "ducks/sendPayment"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, Asset, AssetType } from "types/types.d"; diff --git a/src/components/Sep31Send.tsx b/packages/demo-wallet-client/src/components/Sep31Send.tsx similarity index 97% rename from src/components/Sep31Send.tsx rename to packages/demo-wallet-client/src/components/Sep31Send.tsx index d904918d..b580f263 100644 --- a/src/components/Sep31Send.tsx +++ b/packages/demo-wallet-client/src/components/Sep31Send.tsx @@ -9,7 +9,7 @@ import { Heading3, DetailsTooltip, } from "@stellar/design-system"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { fetchAccountAction } from "ducks/account"; import { resetActiveAssetAction } from "ducks/activeAsset"; import { @@ -18,7 +18,7 @@ import { setCustomerTypesAction, fetchSendFieldsAction, } from "ducks/sep31Send"; -import { capitalizeString } from "helpers/capitalizeString"; +import { capitalizeString } from "demo-wallet-shared/build/helpers/capitalizeString"; import { useRedux } from "hooks/useRedux"; import { ActionStatus } from "types/types.d"; diff --git a/src/components/Sep6/Sep6Deposit.tsx b/packages/demo-wallet-client/src/components/Sep6/Sep6Deposit.tsx similarity index 99% rename from src/components/Sep6/Sep6Deposit.tsx rename to packages/demo-wallet-client/src/components/Sep6/Sep6Deposit.tsx index 9a17a270..7977cb3b 100644 --- a/src/components/Sep6/Sep6Deposit.tsx +++ b/packages/demo-wallet-client/src/components/Sep6/Sep6Deposit.tsx @@ -10,7 +10,7 @@ import { DetailsTooltip, } from "@stellar/design-system"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { resetActiveAssetAction } from "ducks/activeAsset"; import { resetSep6DepositAction, diff --git a/src/components/Sep6/Sep6Withdraw.tsx b/packages/demo-wallet-client/src/components/Sep6/Sep6Withdraw.tsx similarity index 98% rename from src/components/Sep6/Sep6Withdraw.tsx rename to packages/demo-wallet-client/src/components/Sep6/Sep6Withdraw.tsx index aa3bc834..9a54c97b 100644 --- a/src/components/Sep6/Sep6Withdraw.tsx +++ b/packages/demo-wallet-client/src/components/Sep6/Sep6Withdraw.tsx @@ -10,7 +10,7 @@ import { DetailsTooltip, } from "@stellar/design-system"; import { ErrorMessage } from "components/ErrorMessage"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { resetActiveAssetAction } from "ducks/activeAsset"; import { resetSep6WithdrawAction, @@ -18,7 +18,7 @@ import { sep6WithdrawAction, } from "ducks/sep6WithdrawAsset"; import { useRedux } from "hooks/useRedux"; -import { shortenStellarKey } from "helpers/shortenStellarKey"; +import { shortenStellarKey } from "demo-wallet-shared/build/helpers/shortenStellarKey"; import { ActionStatus, AnyObject } from "types/types.d"; export const Sep6Withdraw = () => { diff --git a/src/components/Sep8Send/Sep8ActionRequiredForm.tsx b/packages/demo-wallet-client/src/components/Sep8Send/Sep8ActionRequiredForm.tsx similarity index 96% rename from src/components/Sep8Send/Sep8ActionRequiredForm.tsx rename to packages/demo-wallet-client/src/components/Sep8Send/Sep8ActionRequiredForm.tsx index 3e843fe4..9d84bcb0 100644 --- a/src/components/Sep8Send/Sep8ActionRequiredForm.tsx +++ b/packages/demo-wallet-client/src/components/Sep8Send/Sep8ActionRequiredForm.tsx @@ -2,13 +2,16 @@ import React, { useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { Button, Input, Modal } from "@stellar/design-system"; import { ErrorMessage } from "components/ErrorMessage"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { initiateSep8SendAction, sep8ReviseTransactionAction, sep8SendActionRequiredFieldsAction, } from "ducks/sep8Send"; -import { Sep9Field, Sep9FieldType } from "helpers/Sep9Fields"; +import { + Sep9Field, + Sep9FieldType, +} from "demo-wallet-shared/build/helpers/Sep9Fields"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, diff --git a/src/components/Sep8Send/Sep8Approval.tsx b/packages/demo-wallet-client/src/components/Sep8Send/Sep8Approval.tsx similarity index 96% rename from src/components/Sep8Send/Sep8Approval.tsx rename to packages/demo-wallet-client/src/components/Sep8Send/Sep8Approval.tsx index c69de57d..a86ac553 100644 --- a/src/components/Sep8Send/Sep8Approval.tsx +++ b/packages/demo-wallet-client/src/components/Sep8Send/Sep8Approval.tsx @@ -10,12 +10,12 @@ import { } from "@stellar/design-system"; import { DataProvider } from "@stellar/wallet-sdk"; import { ErrorMessage } from "components/ErrorMessage"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { sep8ClearErrorAction, sep8ReviseTransactionAction, } from "ducks/sep8Send"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, Sep8Step } from "types/types.d"; diff --git a/src/components/Sep8Send/Sep8Review.tsx b/packages/demo-wallet-client/src/components/Sep8Send/Sep8Review.tsx similarity index 95% rename from src/components/Sep8Send/Sep8Review.tsx rename to packages/demo-wallet-client/src/components/Sep8Send/Sep8Review.tsx index a40f9fee..1c0b28fe 100644 --- a/src/components/Sep8Send/Sep8Review.tsx +++ b/packages/demo-wallet-client/src/components/Sep8Send/Sep8Review.tsx @@ -4,10 +4,10 @@ import { Transaction, TransactionBuilder } from "stellar-sdk"; import { Button, Checkbox, Modal, Heading3 } from "@stellar/design-system"; import { ErrorMessage } from "components/ErrorMessage"; import { Json } from "components/Json"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { fetchAccountAction } from "ducks/account"; import { sep8SubmitRevisedTransactionAction } from "ducks/sep8Send"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, Sep8Step } from "types/types.d"; diff --git a/src/components/Sep8Send/index.tsx b/packages/demo-wallet-client/src/components/Sep8Send/index.tsx similarity index 100% rename from src/components/Sep8Send/index.tsx rename to packages/demo-wallet-client/src/components/Sep8Send/index.tsx diff --git a/src/components/SettingsHandler.tsx b/packages/demo-wallet-client/src/components/SettingsHandler.tsx similarity index 95% rename from src/components/SettingsHandler.tsx rename to packages/demo-wallet-client/src/components/SettingsHandler.tsx index 60b5c970..3803753d 100644 --- a/src/components/SettingsHandler.tsx +++ b/packages/demo-wallet-client/src/components/SettingsHandler.tsx @@ -5,8 +5,8 @@ import { Keypair } from "stellar-sdk"; import { fetchAccountAction } from "ducks/account"; import { fetchClaimableBalancesAction } from "ducks/claimableBalances"; import { updateSettingsAction } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, SearchParams } from "types/types.d"; diff --git a/src/components/SignOutModal.tsx b/packages/demo-wallet-client/src/components/SignOutModal.tsx similarity index 95% rename from src/components/SignOutModal.tsx rename to packages/demo-wallet-client/src/components/SignOutModal.tsx index e366381c..b8304232 100644 --- a/src/components/SignOutModal.tsx +++ b/packages/demo-wallet-client/src/components/SignOutModal.tsx @@ -10,7 +10,7 @@ import { CopyText, } from "@stellar/design-system"; import { resetStoreAction } from "config/store"; -import { getCurrentSessionParams } from "helpers/getCurrentSessionParams"; +import { getCurrentSessionParams } from "demo-wallet-shared/build/helpers/getCurrentSessionParams"; import { SearchParams, StringObject } from "types/types.d"; export const SignOutModal = ({ onClose }: { onClose: () => void }) => { diff --git a/src/components/ToastBanner/index.tsx b/packages/demo-wallet-client/src/components/ToastBanner/index.tsx similarity index 100% rename from src/components/ToastBanner/index.tsx rename to packages/demo-wallet-client/src/components/ToastBanner/index.tsx diff --git a/src/components/ToastBanner/styles.scss b/packages/demo-wallet-client/src/components/ToastBanner/styles.scss similarity index 100% rename from src/components/ToastBanner/styles.scss rename to packages/demo-wallet-client/src/components/ToastBanner/styles.scss diff --git a/src/components/UntrustedBalance.tsx b/packages/demo-wallet-client/src/components/UntrustedBalance.tsx similarity index 97% rename from src/components/UntrustedBalance.tsx rename to packages/demo-wallet-client/src/components/UntrustedBalance.tsx index cef52b97..8433fbe9 100644 --- a/src/components/UntrustedBalance.tsx +++ b/packages/demo-wallet-client/src/components/UntrustedBalance.tsx @@ -13,8 +13,8 @@ import { removeUntrustedAssetAction, resetUntrustedAssetStatusAction, } from "ducks/untrustedAssets"; -import { log } from "helpers/log"; -import { searchParam } from "helpers/searchParam"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, diff --git a/src/components/WarningBanner.tsx b/packages/demo-wallet-client/src/components/WarningBanner.tsx similarity index 100% rename from src/components/WarningBanner.tsx rename to packages/demo-wallet-client/src/components/WarningBanner.tsx diff --git a/src/config/store.ts b/packages/demo-wallet-client/src/config/store.ts similarity index 93% rename from src/config/store.ts rename to packages/demo-wallet-client/src/config/store.ts index 970a3153..fd5d420e 100644 --- a/src/config/store.ts +++ b/packages/demo-wallet-client/src/config/store.ts @@ -75,3 +75,6 @@ export const store = configureStore({ }), ], }); + +export const walletBackendEndpoint: string = process.env.REACT_APP_WALLET_BACKEND_ENDPOINT ?? ""; +export const clientDomain: string = process.env.REACT_APP_CLIENT_DOMAIN ?? ""; diff --git a/src/ducks/account.ts b/packages/demo-wallet-client/src/ducks/account.ts similarity index 94% rename from src/ducks/account.ts rename to packages/demo-wallet-client/src/ducks/account.ts index f8523fde..f25036fb 100644 --- a/src/ducks/account.ts +++ b/packages/demo-wallet-client/src/ducks/account.ts @@ -5,11 +5,11 @@ import { Keypair } from "stellar-sdk"; import { RootState } from "config/store"; import { settingsSelector } from "ducks/settings"; -import { getAssetData } from "helpers/getAssetData"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getErrorString } from "helpers/getErrorString"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getAssetData } from "demo-wallet-shared/build/helpers/getAssetData"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getErrorString } from "demo-wallet-shared/build/helpers/getErrorString"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { ActionStatus, Asset, diff --git a/src/ducks/activeAsset.ts b/packages/demo-wallet-client/src/ducks/activeAsset.ts similarity index 100% rename from src/ducks/activeAsset.ts rename to packages/demo-wallet-client/src/ducks/activeAsset.ts diff --git a/src/ducks/allAssets.ts b/packages/demo-wallet-client/src/ducks/allAssets.ts similarity index 95% rename from src/ducks/allAssets.ts rename to packages/demo-wallet-client/src/ducks/allAssets.ts index 2bcd4ad6..d528633a 100644 --- a/src/ducks/allAssets.ts +++ b/packages/demo-wallet-client/src/ducks/allAssets.ts @@ -3,8 +3,8 @@ import { RootState } from "config/store"; import { accountSelector } from "ducks/account"; import { assetOverridesSelector } from "ducks/assetOverrides"; import { untrustedAssetsSelector } from "ducks/untrustedAssets"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { ActionStatus, RejectMessage, diff --git a/src/ducks/assetOverrides.ts b/packages/demo-wallet-client/src/ducks/assetOverrides.ts similarity index 78% rename from src/ducks/assetOverrides.ts rename to packages/demo-wallet-client/src/ducks/assetOverrides.ts index 38661a24..843133ee 100644 --- a/src/ducks/assetOverrides.ts +++ b/packages/demo-wallet-client/src/ducks/assetOverrides.ts @@ -1,11 +1,11 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import { RootState } from "config/store"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getAssetOverridesData } from "helpers/getAssetOverridesData"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { searchKeyPairStringToArray } from "helpers/searchKeyPairStringToArray"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getAssetOverridesData } from "demo-wallet-shared/build/helpers/getAssetOverridesData"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { searchKeyPairStringToArray } from "demo-wallet-shared/build/helpers/searchKeyPairStringToArray"; import { ActionStatus, Asset, @@ -75,7 +75,5 @@ export const assetOverridesSelector = (state: RootState) => state.assetOverrides; export const { reducer } = assetOverridesSlice; -export const { - resetAssetOverridesStatusAction, - resetAssetOverridesAction, -} = assetOverridesSlice.actions; +export const { resetAssetOverridesStatusAction, resetAssetOverridesAction } = + assetOverridesSlice.actions; diff --git a/src/ducks/claimAsset.ts b/packages/demo-wallet-client/src/ducks/claimAsset.ts similarity index 88% rename from src/ducks/claimAsset.ts rename to packages/demo-wallet-client/src/ducks/claimAsset.ts index 3cbf4cf4..a781fda9 100644 --- a/src/ducks/claimAsset.ts +++ b/packages/demo-wallet-client/src/ducks/claimAsset.ts @@ -3,11 +3,11 @@ import { BASE_FEE } from "stellar-sdk"; import { RootState } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { claimClaimableBalance } from "methods/claimClaimableBalance"; -import { trustAsset } from "methods/trustAsset"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { claimClaimableBalance } from "demo-wallet-shared/build/methods/claimClaimableBalance"; +import { trustAsset } from "demo-wallet-shared/build/methods/trustAsset"; import { ActionStatus, ClaimAssetInitialState, diff --git a/src/ducks/claimableBalances.ts b/packages/demo-wallet-client/src/ducks/claimableBalances.ts similarity index 93% rename from src/ducks/claimableBalances.ts rename to packages/demo-wallet-client/src/ducks/claimableBalances.ts index df8bd6ec..7d78f042 100644 --- a/src/ducks/claimableBalances.ts +++ b/packages/demo-wallet-client/src/ducks/claimableBalances.ts @@ -2,9 +2,9 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import StellarSdk, { ServerApi } from "stellar-sdk"; import { RootState } from "config/store"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { ActionStatus, AssetType, diff --git a/src/ducks/logs.ts b/packages/demo-wallet-client/src/ducks/logs.ts similarity index 100% rename from src/ducks/logs.ts rename to packages/demo-wallet-client/src/ducks/logs.ts diff --git a/src/ducks/sendPayment.ts b/packages/demo-wallet-client/src/ducks/sendPayment.ts similarity index 88% rename from src/ducks/sendPayment.ts rename to packages/demo-wallet-client/src/ducks/sendPayment.ts index 2b278544..50956f75 100644 --- a/src/ducks/sendPayment.ts +++ b/packages/demo-wallet-client/src/ducks/sendPayment.ts @@ -2,9 +2,9 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import { Horizon } from "stellar-sdk"; import { RootState } from "config/store"; import { settingsSelector } from "ducks/settings"; -import { getErrorString } from "helpers/getErrorString"; -import { log } from "helpers/log"; -import { submitPaymentTransaction } from "methods/submitPaymentTransaction"; +import { getErrorString } from "demo-wallet-shared/build/helpers/getErrorString"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { submitPaymentTransaction } from "demo-wallet-shared/build/methods/submitPaymentTransaction"; import { ActionStatus, PaymentTransactionParams, diff --git a/src/ducks/sep24DepositAsset.ts b/packages/demo-wallet-client/src/ducks/sep24DepositAsset.ts similarity index 82% rename from src/ducks/sep24DepositAsset.ts rename to packages/demo-wallet-client/src/ducks/sep24DepositAsset.ts index 6553e5fc..a4b6c412 100644 --- a/src/ducks/sep24DepositAsset.ts +++ b/packages/demo-wallet-client/src/ducks/sep24DepositAsset.ts @@ -1,23 +1,23 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; -import { RootState } from "config/store"; +import { RootState, walletBackendEndpoint, clientDomain } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { sep10AuthStart, sep10AuthSign, sep10AuthSend, -} from "methods/sep10Auth"; +} from "demo-wallet-shared/build/methods/sep10Auth"; import { checkInfo, interactiveDepositFlow, createPopup, pollDepositUntilComplete, -} from "methods/sep24"; -import { checkTomlForFields } from "methods/checkTomlForFields"; -import { trustAsset } from "methods/trustAsset"; +} from "demo-wallet-shared/build/methods/sep24"; +import { checkTomlForFields } from "demo-wallet-shared/build/methods/checkTomlForFields"; +import { trustAsset } from "demo-wallet-shared/build/methods/trustAsset"; import { Asset, ActionStatus, @@ -102,13 +102,15 @@ export const depositAssetAction = createAsyncThunk< serverSigningKey: tomlResponse.SIGNING_KEY, publicKey, homeDomain, + clientDomain, }); // SEP-10 sign - const signedChallengeTransaction = sep10AuthSign({ + const signedChallengeTransaction = await sep10AuthSign({ secretKey, networkPassphrase: networkConfig.network, challengeTransaction, + walletBackendEndpoint, }); // SEP-10 send @@ -130,16 +132,14 @@ export const depositAssetAction = createAsyncThunk< const popup = createPopup(interactiveResponse.url); // Poll transaction until complete - const { - currentStatus, - trustedAssetAdded, - } = await pollDepositUntilComplete({ - popup, - transactionId: interactiveResponse.id, - token, - sep24TransferServerUrl: tomlResponse.TRANSFER_SERVER_SEP0024, - trustAssetCallback, - }); + const { currentStatus, trustedAssetAdded } = + await pollDepositUntilComplete({ + popup, + transactionId: interactiveResponse.id, + token, + sep24TransferServerUrl: tomlResponse.TRANSFER_SERVER_SEP0024, + trustAssetCallback, + }); return { currentStatus, diff --git a/src/ducks/sep24WithdrawAsset.ts b/packages/demo-wallet-client/src/ducks/sep24WithdrawAsset.ts similarity index 86% rename from src/ducks/sep24WithdrawAsset.ts rename to packages/demo-wallet-client/src/ducks/sep24WithdrawAsset.ts index d000d7b3..72389353 100644 --- a/src/ducks/sep24WithdrawAsset.ts +++ b/packages/demo-wallet-client/src/ducks/sep24WithdrawAsset.ts @@ -1,22 +1,22 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; -import { RootState } from "config/store"; +import { RootState, walletBackendEndpoint, clientDomain } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { sep10AuthStart, sep10AuthSign, sep10AuthSend, -} from "methods/sep10Auth"; +} from "demo-wallet-shared/build/methods/sep10Auth"; import { checkInfo, interactiveWithdrawFlow, createPopup, pollWithdrawUntilComplete, -} from "methods/sep24"; -import { checkTomlForFields } from "methods/checkTomlForFields"; +} from "demo-wallet-shared/build/methods/sep24"; +import { checkTomlForFields } from "demo-wallet-shared/build/methods/checkTomlForFields"; import { Asset, ActionStatus, @@ -81,13 +81,15 @@ export const withdrawAssetAction = createAsyncThunk< serverSigningKey: tomlResponse.SIGNING_KEY, publicKey, homeDomain, + clientDomain, }); // SEP-10 sign - const signedChallengeTransaction = sep10AuthSign({ + const signedChallengeTransaction = await sep10AuthSign({ secretKey, networkPassphrase: networkConfig.network, challengeTransaction, + walletBackendEndpoint, }); // SEP-10 send @@ -169,6 +171,5 @@ const sep24WithdrawAssetSlice = createSlice({ }); export const { reducer } = sep24WithdrawAssetSlice; -export const { - resetSep24WithdrawAssetAction, -} = sep24WithdrawAssetSlice.actions; +export const { resetSep24WithdrawAssetAction } = + sep24WithdrawAssetSlice.actions; diff --git a/src/ducks/sep31Send.ts b/packages/demo-wallet-client/src/ducks/sep31Send.ts similarity index 95% rename from src/ducks/sep31Send.ts rename to packages/demo-wallet-client/src/ducks/sep31Send.ts index b96587b4..f729631a 100644 --- a/src/ducks/sep31Send.ts +++ b/packages/demo-wallet-client/src/ducks/sep31Send.ts @@ -1,16 +1,16 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; -import { RootState } from "config/store"; +import { RootState, walletBackendEndpoint, clientDomain } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { sep10AuthStart, sep10AuthSign, sep10AuthSend, -} from "methods/sep10Auth"; +} from "demo-wallet-shared/build/methods/sep10Auth"; import { checkInfo, getSep12Fields, @@ -19,8 +19,8 @@ import { pollTransactionUntilReady, sendPayment, pollTransactionUntilComplete, -} from "methods/sep31Send"; -import { checkTomlForFields } from "methods/checkTomlForFields"; +} from "demo-wallet-shared/build/methods/sep31Send"; +import { checkTomlForFields } from "demo-wallet-shared/build/methods/checkTomlForFields"; import { Asset, @@ -214,13 +214,15 @@ export const fetchSendFieldsAction = createAsyncThunk< serverSigningKey, publicKey, homeDomain, + clientDomain, }); // SEP-10 sign - const signedChallengeTransaction = sep10AuthSign({ + const signedChallengeTransaction = await sep10AuthSign({ secretKey, networkPassphrase: networkConfig.network, challengeTransaction, + walletBackendEndpoint, }); // SEP-10 send diff --git a/src/ducks/sep6DepositAsset.ts b/packages/demo-wallet-client/src/ducks/sep6DepositAsset.ts similarity index 91% rename from src/ducks/sep6DepositAsset.ts rename to packages/demo-wallet-client/src/ducks/sep6DepositAsset.ts index 4a5b3643..9cc6cfdf 100644 --- a/src/ducks/sep6DepositAsset.ts +++ b/packages/demo-wallet-client/src/ducks/sep6DepositAsset.ts @@ -1,23 +1,26 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; -import { RootState } from "config/store"; +import { RootState, walletBackendEndpoint, clientDomain } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { checkDepositWithdrawInfo } from "methods/checkDepositWithdrawInfo"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { checkDepositWithdrawInfo } from "demo-wallet-shared/build/methods/checkDepositWithdrawInfo"; import { pollDepositUntilComplete, programmaticDepositFlow, -} from "methods/sep6"; +} from "demo-wallet-shared/build/methods/sep6"; import { sep10AuthStart, sep10AuthSign, sep10AuthSend, -} from "methods/sep10Auth"; -import { collectSep12Fields, putSep12FieldsRequest } from "methods/sep12"; -import { checkTomlForFields } from "methods/checkTomlForFields"; -import { trustAsset } from "methods/trustAsset"; +} from "demo-wallet-shared/build/methods/sep10Auth"; +import { + collectSep12Fields, + putSep12FieldsRequest, +} from "demo-wallet-shared/build/methods/sep12"; +import { checkTomlForFields } from "demo-wallet-shared/build/methods/checkTomlForFields"; +import { trustAsset } from "demo-wallet-shared/build/methods/trustAsset"; import { Asset, ActionStatus, @@ -113,19 +116,22 @@ export const initiateDepositAction = createAsyncThunk< title: "SEP-6 deposit is enabled, and requires authentication so we should go through SEP-10", }); + // SEP-10 start const challengeTransaction = await sep10AuthStart({ authEndpoint: webAuthTomlResponse.WEB_AUTH_ENDPOINT, serverSigningKey: webAuthTomlResponse.SIGNING_KEY, publicKey, homeDomain, + clientDomain, }); // SEP-10 sign - const signedChallengeTransaction = sep10AuthSign({ + const signedChallengeTransaction = await sep10AuthSign({ secretKey, networkPassphrase: networkConfig.network, challengeTransaction, + walletBackendEndpoint, }); // SEP-10 send diff --git a/src/ducks/sep6WithdrawAsset.ts b/packages/demo-wallet-client/src/ducks/sep6WithdrawAsset.ts similarity index 91% rename from src/ducks/sep6WithdrawAsset.ts rename to packages/demo-wallet-client/src/ducks/sep6WithdrawAsset.ts index af022d2f..7efc730d 100644 --- a/src/ducks/sep6WithdrawAsset.ts +++ b/packages/demo-wallet-client/src/ducks/sep6WithdrawAsset.ts @@ -1,22 +1,25 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; -import { RootState } from "config/store"; +import { RootState, walletBackendEndpoint, clientDomain } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { checkDepositWithdrawInfo } from "methods/checkDepositWithdrawInfo"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { checkDepositWithdrawInfo } from "demo-wallet-shared/build/methods/checkDepositWithdrawInfo"; import { pollWithdrawUntilComplete, programmaticWithdrawFlow, -} from "methods/sep6"; +} from "demo-wallet-shared/build/methods/sep6"; import { sep10AuthStart, sep10AuthSign, sep10AuthSend, -} from "methods/sep10Auth"; -import { collectSep12Fields, putSep12FieldsRequest } from "methods/sep12"; -import { checkTomlForFields } from "methods/checkTomlForFields"; +} from "demo-wallet-shared/build/methods/sep10Auth"; +import { + collectSep12Fields, + putSep12FieldsRequest, +} from "demo-wallet-shared/build/methods/sep12"; +import { checkTomlForFields } from "demo-wallet-shared/build/methods/checkTomlForFields"; import { Asset, ActionStatus, @@ -77,9 +80,8 @@ export const initiateWithdrawAction = createAsyncThunk< const assetInfoData = infoData[AnchorActionType.WITHDRAWAL][assetCode]; - const { - authentication_required: isAuthenticationRequired, - } = assetInfoData; + const { authentication_required: isAuthenticationRequired } = + assetInfoData; let payload = { assetCode, @@ -109,19 +111,22 @@ export const initiateWithdrawAction = createAsyncThunk< title: "SEP-6 withdrawal is enabled, and requires authentication so we should go through SEP-10", }); + // SEP-10 start const challengeTransaction = await sep10AuthStart({ authEndpoint: webAuthTomlResponse.WEB_AUTH_ENDPOINT, serverSigningKey: webAuthTomlResponse.SIGNING_KEY, publicKey, homeDomain, + clientDomain, }); // SEP-10 sign - const signedChallengeTransaction = sep10AuthSign({ + const signedChallengeTransaction = await sep10AuthSign({ secretKey, networkPassphrase: networkConfig.network, challengeTransaction, + walletBackendEndpoint, }); // SEP-10 send diff --git a/src/ducks/sep8Send.ts b/packages/demo-wallet-client/src/ducks/sep8Send.ts similarity index 91% rename from src/ducks/sep8Send.ts rename to packages/demo-wallet-client/src/ducks/sep8Send.ts index f2e6bdac..f4bac8fd 100644 --- a/src/ducks/sep8Send.ts +++ b/packages/demo-wallet-client/src/ducks/sep8Send.ts @@ -1,15 +1,15 @@ import { Horizon } from "stellar-sdk"; import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; -import { RootState } from "config/store"; +import { RootState} from "config/store"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getErrorString } from "helpers/getErrorString"; -import { getSep8NextStepOnSuccess } from "helpers/getSep8NextStepOnSuccess"; -import { log } from "helpers/log"; -import { getToml } from "methods/getToml"; -import { revisePaymentTransaction } from "methods/sep8Send/revisePaymentTransaction"; -import { sendActionRequiredFields } from "methods/sep8Send/sendActionRequiredFields"; -import { submitRevisedTransaction } from "methods/sep8Send/submitRevisedTransaction"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getErrorString } from "demo-wallet-shared/build/helpers/getErrorString"; +import { getSep8NextStepOnSuccess } from "demo-wallet-shared/build/helpers/getSep8NextStepOnSuccess"; +import { log } from "demo-wallet-shared/build/helpers/log"; +import { getToml } from "demo-wallet-shared/build/methods/getToml"; +import { revisePaymentTransaction } from "demo-wallet-shared/build/methods/sep8Send/revisePaymentTransaction"; +import { sendActionRequiredFields } from "demo-wallet-shared/build/methods/sep8Send/sendActionRequiredFields"; +import { submitRevisedTransaction } from "demo-wallet-shared/build/methods/sep8Send/submitRevisedTransaction"; import { Sep8ActionRequiredSendParams, ActionStatus, @@ -334,7 +334,5 @@ const sep8SendSlice = createSlice({ export const sep8SendSelector = (state: RootState) => state.sep8Send; export const { reducer } = sep8SendSlice; -export const { - resetSep8SendAction, - sep8ClearErrorAction, -} = sep8SendSlice.actions; +export const { resetSep8SendAction, sep8ClearErrorAction } = + sep8SendSlice.actions; diff --git a/src/ducks/settings.ts b/packages/demo-wallet-client/src/ducks/settings.ts similarity index 100% rename from src/ducks/settings.ts rename to packages/demo-wallet-client/src/ducks/settings.ts diff --git a/src/ducks/trustAsset.ts b/packages/demo-wallet-client/src/ducks/trustAsset.ts similarity index 89% rename from src/ducks/trustAsset.ts rename to packages/demo-wallet-client/src/ducks/trustAsset.ts index 9623295f..bd05f308 100644 --- a/src/ducks/trustAsset.ts +++ b/packages/demo-wallet-client/src/ducks/trustAsset.ts @@ -1,9 +1,9 @@ import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import { RootState } from "config/store"; import { settingsSelector } from "ducks/settings"; -import { getErrorString } from "helpers/getErrorString"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { trustAsset } from "methods/trustAsset"; +import { getErrorString } from "demo-wallet-shared/build/helpers/getErrorString"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { trustAsset } from "demo-wallet-shared/build/methods/trustAsset"; import { ActionStatus, RejectMessage, diff --git a/src/ducks/untrustedAssets.ts b/packages/demo-wallet-client/src/ducks/untrustedAssets.ts similarity index 92% rename from src/ducks/untrustedAssets.ts rename to packages/demo-wallet-client/src/ducks/untrustedAssets.ts index b4143306..6c0439f9 100644 --- a/src/ducks/untrustedAssets.ts +++ b/packages/demo-wallet-client/src/ducks/untrustedAssets.ts @@ -3,10 +3,10 @@ import { getCatchError } from "@stellar/frontend-helpers"; import { RootState } from "config/store"; import { accountSelector } from "ducks/account"; import { settingsSelector } from "ducks/settings"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getUntrustedAssetData } from "helpers/getUntrustedAssetData"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getErrorMessage } from "demo-wallet-shared/build/helpers/getErrorMessage"; +import { getUntrustedAssetData } from "demo-wallet-shared/build/helpers/getUntrustedAssetData"; +import { getNetworkConfig } from "demo-wallet-shared/build/helpers/getNetworkConfig"; +import { log } from "demo-wallet-shared/build/helpers/log"; import { ActionStatus, RejectMessage, diff --git a/src/hooks/useRedux.ts b/packages/demo-wallet-client/src/hooks/useRedux.ts similarity index 100% rename from src/hooks/useRedux.ts rename to packages/demo-wallet-client/src/hooks/useRedux.ts diff --git a/src/index.tsx b/packages/demo-wallet-client/src/index.tsx similarity index 100% rename from src/index.tsx rename to packages/demo-wallet-client/src/index.tsx diff --git a/src/pages/Account.tsx b/packages/demo-wallet-client/src/pages/Account.tsx similarity index 95% rename from src/pages/Account.tsx rename to packages/demo-wallet-client/src/pages/Account.tsx index 4ec53bb5..7880c395 100644 --- a/src/pages/Account.tsx +++ b/packages/demo-wallet-client/src/pages/Account.tsx @@ -8,7 +8,7 @@ import { Sep6Deposit } from "components/Sep6/Sep6Deposit"; import { Sep6Withdraw } from "components/Sep6/Sep6Withdraw"; import { Sep8Send } from "components/Sep8Send"; import { Sep31Send } from "components/Sep31Send"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { resetActiveAssetAction } from "ducks/activeAsset"; import { useRedux } from "hooks/useRedux"; import { Asset } from "types/types.d"; diff --git a/src/pages/Landing.tsx b/packages/demo-wallet-client/src/pages/Landing.tsx similarity index 91% rename from src/pages/Landing.tsx rename to packages/demo-wallet-client/src/pages/Landing.tsx index 55c2ad04..ae142348 100644 --- a/src/pages/Landing.tsx +++ b/packages/demo-wallet-client/src/pages/Landing.tsx @@ -10,11 +10,11 @@ import { } from "@stellar/design-system"; import { metrics } from "@stellar/frontend-helpers"; -import { METRIC_NAMES } from "constants/metricNames"; -import { CSS_MODAL_PARENT_ID } from "constants/settings"; +import { METRIC_NAMES } from "demo-wallet-shared/build/constants/metricNames"; +import { CSS_MODAL_PARENT_ID } from "demo-wallet-shared/build/constants/settings"; import { createRandomAccount } from "ducks/account"; import { ConnectAccount } from "components/ConnectAccount"; -import { searchParam } from "helpers/searchParam"; +import { searchParam } from "demo-wallet-shared/build/helpers/searchParam"; import { useRedux } from "hooks/useRedux"; import { ActionStatus, SearchParams } from "types/types.d"; diff --git a/src/pages/NotFound.tsx b/packages/demo-wallet-client/src/pages/NotFound.tsx similarity index 100% rename from src/pages/NotFound.tsx rename to packages/demo-wallet-client/src/pages/NotFound.tsx diff --git a/src/react-app-env.d.ts b/packages/demo-wallet-client/src/react-app-env.d.ts similarity index 100% rename from src/react-app-env.d.ts rename to packages/demo-wallet-client/src/react-app-env.d.ts diff --git a/src/reportWebVitals.ts b/packages/demo-wallet-client/src/reportWebVitals.ts similarity index 100% rename from src/reportWebVitals.ts rename to packages/demo-wallet-client/src/reportWebVitals.ts diff --git a/src/setupTests.ts b/packages/demo-wallet-client/src/setupTests.ts similarity index 100% rename from src/setupTests.ts rename to packages/demo-wallet-client/src/setupTests.ts diff --git a/src/types/@modules.d.ts b/packages/demo-wallet-client/src/types/@modules.d.ts similarity index 86% rename from src/types/@modules.d.ts rename to packages/demo-wallet-client/src/types/@modules.d.ts index 29d6635a..9880721e 100644 --- a/src/types/@modules.d.ts +++ b/packages/demo-wallet-client/src/types/@modules.d.ts @@ -5,5 +5,3 @@ declare module "*.svg" { const src: string; export default src; } - -declare module "dompurify"; diff --git a/src/types/types.d.ts b/packages/demo-wallet-client/src/types/types.d.ts similarity index 99% rename from src/types/types.d.ts rename to packages/demo-wallet-client/src/types/types.d.ts index 9df1080c..9a5e0f25 100644 --- a/src/types/types.d.ts +++ b/packages/demo-wallet-client/src/types/types.d.ts @@ -1,7 +1,7 @@ import React, { ReactNode } from "react"; import { Horizon } from "stellar-sdk"; import { Types } from "@stellar/wallet-sdk"; -import { Sep9Field } from "helpers/Sep9Fields"; +import { Sep9Field } from "demo-wallet-shared/build/helpers/Sep9Fields"; export enum SearchParams { SECRET_KEY = "secretKey", diff --git a/packages/demo-wallet-client/tsconfig.json b/packages/demo-wallet-client/tsconfig.json new file mode 100644 index 00000000..3d27cc15 --- /dev/null +++ b/packages/demo-wallet-client/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@stellar/tsconfig", + "compilerOptions": { + "baseUrl": "src/", + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "module": "esnext", + "moduleResolution": "node", + "noEmit": true, + "jsx": "react-jsx", + "allowSyntheticDefaultImports": true + }, + "include": ["src"] +} diff --git a/packages/demo-wallet-server/README.md b/packages/demo-wallet-server/README.md new file mode 100644 index 00000000..f268e258 --- /dev/null +++ b/packages/demo-wallet-server/README.md @@ -0,0 +1,35 @@ +# Stellar Demo Wallet Server + +This Stellar Demo Wallet is the backend to the demo wallet, currently it is only used to host +the stellar.toml file and also sign requests to enable ([SEP-10]) client attribution. During +the signing phase of the SEP-10 flow, the wallet client will make a request to the backend server +to have the backend server sign the challenge that was issued by the anchor server. The wallet client +will then sign the same request with the user's key before sending the challenge back to the anchor +server for verification. + + +### Running the Demo Wallet Server +1. Create a keypair on the Stellar network (you can use the demo wallet for this). + The keypair will be used for the Demo Wallet Server +2. Create a .env file in the package/demo-wallet-server directory. + ``` + SERVER_PORT = 7000 + SERVER_SIGNING_KEY = + ``` +3. Modify the *stellar.toml* file in *package/demo-wallet-server/src/static/well_known* + Replace the **SIGNING_KEY** with the public key that was generated in step 1 +4. Run the server + ``` + yarn start:server + ``` + +### Helpful links + +- [https://www.stellar.org/developers](https://www.stellar.org/developers) +- [https://stellar.github.io/js-stellar-sdk/](https://stellar.github.io/js-stellar-sdk/) +- [https://github.com/stellar/js-stellar-sdk](https://github.com/stellar/js-stellar-sdk) + +[sep-10]: + https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0010.md + + diff --git a/packages/demo-wallet-server/package-lock.json b/packages/demo-wallet-server/package-lock.json new file mode 100644 index 00000000..3b6a51b2 --- /dev/null +++ b/packages/demo-wallet-server/package-lock.json @@ -0,0 +1,185 @@ +{ + "name": "demo-wallet-server", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, + "@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz", + "integrity": "sha512-OUJIVfRMFijZukGGwTpKNFprqCCXk5WjNGvUgB/CxxBR40QWSjsNK86+yvGKlCOGc7sbwfHLaXhkG+NsytwBaQ==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", + "dev": true + }, + "@types/node": { + "version": "16.11.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.8.tgz", + "integrity": "sha512-hmT5gfpRkkHr7DZZHMf3jBe/zNcVGN+jXSL2f8nAsYfBPxQFToKwQlS/zES4Sjp488Bi73i+p6bvrNRRGU0x9Q==", + "dev": true + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true + }, + "@types/serve-static": { + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "dev": true, + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "acorn": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + } + } +} diff --git a/packages/demo-wallet-server/package.json b/packages/demo-wallet-server/package.json new file mode 100644 index 00000000..1b8791ba --- /dev/null +++ b/packages/demo-wallet-server/package.json @@ -0,0 +1,35 @@ +{ + "name": "demo-wallet-server", + "main": "dist/index.js", + "version": "1.0.0", + "description": "Stellar Demo Wallet server", + "repository": { + "type": "git", + "url": "https://github.com/stellar/stellar-demo-wallet.git", + "directory": "packages/demo-wallet-server" + }, + "license": "Apache-2.0", + "lint-staged": { + "src/**/*.ts?(x)": [ + "eslint --fix --max-warnings 0" + ] + }, + "scripts": { + "clean": "rimraf ./build", + "dev": "ts-node ./src/index.ts", + "start": "node ./build/index.js", + "build": "tsc && yarn copy-static-files", + "copy-static-files": "mkdir -p ./build/src/static/well-known/ && cp ./src/static/well_known/* ./build/src/static/well-known/" + }, + "dependencies": { + "express": "^4.17.1", + "stellar-sdk": "^9.1.0", + "ts-node": "^10.4.0", + "typescript": "^4.5.2" + }, + "devDependencies": { + "@types/express": "^4.17.13", + "@types/node": "^16.11.8", + "ts-node": "^10.4.0" + } +} diff --git a/packages/demo-wallet-server/src/index.ts b/packages/demo-wallet-server/src/index.ts new file mode 100644 index 00000000..d38a9ea6 --- /dev/null +++ b/packages/demo-wallet-server/src/index.ts @@ -0,0 +1,46 @@ +import express from "express"; +import { Transaction, Keypair } from "stellar-sdk"; + +require("dotenv").config({ path: require("find-config")(".env") }); + +const PORT = process.env.SERVER_PORT ?? 7000; +const SERVER_SIGNING_KEY = String(process.env.SERVER_SIGNING_KEY); +const app = express(); + +const bodyParser = require("body-parser"); +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); + +//TODO: add logging middleware +// Serve the sep-1 stellar.toml file +app.use("/.well-known", express.static("./src/static/well_known", { + setHeaders: function(res, _) { + res.set("Access-Control-Allow-Headers", "Content-Type,X-Requested-With"); + res.type("application/json"); + console.log("request to /.well-known"); + } +})); + +// Sign requests from the demo wallet client for sep-10 client attribution +app.post("/sign", (req, res) => { + console.log("request to /sign"); + const envelope_xdr = req.body.transaction; + const network_passphrase = req.body.network_passphrase; + const transaction = new Transaction(envelope_xdr, network_passphrase); + + if (Number.parseInt(transaction.sequence, 10) !== 0){ + res.status(400); + res.send("transaction sequence value must be '0'"); + return; + } + + transaction.sign(Keypair.fromSecret(SERVER_SIGNING_KEY)); + + res.set("Access-Control-Allow-Origin", "*"); + res.status(200); + res.send({"transaction": transaction.toEnvelope().toXDR("base64"), "network_passphrase": network_passphrase}); +}); + +app.listen(PORT, () => { + console.log(`Listening on port ${PORT}`); +}); diff --git a/packages/demo-wallet-server/src/static/well_known/stellar.toml b/packages/demo-wallet-server/src/static/well_known/stellar.toml new file mode 100644 index 00000000..5f1f7670 --- /dev/null +++ b/packages/demo-wallet-server/src/static/well_known/stellar.toml @@ -0,0 +1,18 @@ +ACCOUNTS = [ "GBM53YM5CUICEOTGY3N2UJLLZ4QXNCAANINBNLHSNTEULBQ3HENOUU2J", "GDRND2IUXVMHZ4XTB2RZ4AJ3AOLON3WTAOC23XEASB56NHDFW3ED57TW" ] +VERSION = "0.1.0" +SIGNING_KEY = "GBM53YM5CUICEOTGY3N2UJLLZ4QXNCAANINBNLHSNTEULBQ3HENOUU2J" +NETWORK_PASSPHRASE = "Test SDF Network ; September 2015" + +[[PRINCIPALS]] +name = "Stephen Fung" +email = "stephen@stellar.org" +keybase = "stfung77" +github = "https://www.github.com/stfung77" + +[DOCUMENTATION] +ORG_NAME = "Stellar Development Foundation" +ORG_URL = "https://stellar.org" +ORG_DESCRIPTION = "demo wallet backend server." +ORG_KEYBASE = "stellar.public" +ORG_TWITTER = "StellarOrg" +ORG_GITHUB = "stellar" \ No newline at end of file diff --git a/packages/demo-wallet-server/test_files/transaction.json b/packages/demo-wallet-server/test_files/transaction.json new file mode 100644 index 00000000..28fd96eb --- /dev/null +++ b/packages/demo-wallet-server/test_files/transaction.json @@ -0,0 +1,4 @@ +{ + "transaction": "AAAAAgAAAACpn2Fr7GAZ4XOcFvEz+xduBFDK1NDLQP875GtWWlJ0XQAAAMgAAAAAAAAAAAAAAAEAAAAAYZ2KOAAAAABhnY28AAAAAAAAAAIAAAABAAAAAIxsat7eJlK3g7i41ml89dIXfGSZMqZWtfBuv+Zl0ItzAAAACgAAABt0ZXN0YW5jaG9yLnN0ZWxsYXIub3JnIGF1dGgAAAAAAQAAAEBySG11YkErNUREVXJGNjZpdkdDVlFrZnlnZVFHdjZCaCs0NWdYeDQ1VEFXazdtdU9aRHp0QnFRWVY0dWZBYVQvAAAAAQAAAACpn2Fr7GAZ4XOcFvEz+xduBFDK1NDLQP875GtWWlJ0XQAAAAoAAAAPd2ViX2F1dGhfZG9tYWluAAAAAAEAAAAWdGVzdGFuY2hvci5zdGVsbGFyLm9yZwAAAAAAAAAAAAJaUnRdAAAAQGxaESFTJ9wmgZWCgZ3bluJG1p6asiulnrWnde412m19WPg0yJt4ejyENmAFFu/wY8rcFw6ksNjVNmRkV0wtLwtl0ItzAAAAQEkWRfyubSmNAn+ZwyKeUAVFOz8iUdhof+XO9jBf6Oz+xbuIRdMbDsqpqY21BZdjuqx/5lxj8PArlT4eVXxvHgw=", + "network_passphrase": "Test SDF Network ; September 2015" +} \ No newline at end of file diff --git a/packages/demo-wallet-server/tsconfig.json b/packages/demo-wallet-server/tsconfig.json new file mode 100644 index 00000000..be4a3b87 --- /dev/null +++ b/packages/demo-wallet-server/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "esModuleInterop": true, + "moduleResolution": "node", + "sourceMap": true, + "outDir": "build", + "allowJs": true + }, + "lib": ["es2015"] +} diff --git a/src/constants/metricNames.ts b/packages/demo-wallet-shared/constants/metricNames.ts similarity index 100% rename from src/constants/metricNames.ts rename to packages/demo-wallet-shared/constants/metricNames.ts diff --git a/src/constants/presetAssets.ts b/packages/demo-wallet-shared/constants/presetAssets.ts similarity index 87% rename from src/constants/presetAssets.ts rename to packages/demo-wallet-shared/constants/presetAssets.ts index fa2024ea..e4a127ca 100644 --- a/src/constants/presetAssets.ts +++ b/packages/demo-wallet-shared/constants/presetAssets.ts @@ -1,4 +1,4 @@ -import { presetAsset } from "types/types.d"; +import { presetAsset } from "../types/types"; export const PRESET_ASSETS: presetAsset[] = [ { diff --git a/src/constants/settings.ts b/packages/demo-wallet-shared/constants/settings.ts similarity index 100% rename from src/constants/settings.ts rename to packages/demo-wallet-shared/constants/settings.ts diff --git a/src/helpers/Sep9Fields.ts b/packages/demo-wallet-shared/helpers/Sep9Fields.ts similarity index 100% rename from src/helpers/Sep9Fields.ts rename to packages/demo-wallet-shared/helpers/Sep9Fields.ts diff --git a/src/helpers/Struct.ts b/packages/demo-wallet-shared/helpers/Struct.ts similarity index 96% rename from src/helpers/Struct.ts rename to packages/demo-wallet-shared/helpers/Struct.ts index 5a5a223e..db1bce40 100644 --- a/src/helpers/Struct.ts +++ b/packages/demo-wallet-shared/helpers/Struct.ts @@ -1,4 +1,4 @@ -import { AnyObject } from "types/types.d"; +import { AnyObject } from "../types/types"; // These props are accessed whenever react-devtools is used. // We need to bypass them, otherwise it'll explode with an exception. diff --git a/src/helpers/capitalizeString.ts b/packages/demo-wallet-shared/helpers/capitalizeString.ts similarity index 100% rename from src/helpers/capitalizeString.ts rename to packages/demo-wallet-shared/helpers/capitalizeString.ts diff --git a/src/helpers/checkAssetExists.ts b/packages/demo-wallet-shared/helpers/checkAssetExists.ts similarity index 100% rename from src/helpers/checkAssetExists.ts rename to packages/demo-wallet-shared/helpers/checkAssetExists.ts diff --git a/src/helpers/getAssetData.ts b/packages/demo-wallet-shared/helpers/getAssetData.ts similarity index 80% rename from src/helpers/getAssetData.ts rename to packages/demo-wallet-shared/helpers/getAssetData.ts index 1159f1db..a2d2b324 100644 --- a/src/helpers/getAssetData.ts +++ b/packages/demo-wallet-shared/helpers/getAssetData.ts @@ -1,7 +1,7 @@ import { Types } from "@stellar/wallet-sdk"; -import { getAssetSettingsFromToml } from "helpers/getAssetSettingsFromToml"; -import { normalizeAssetProps } from "helpers/normalizeAssetProps"; -import { Asset } from "types/types.d"; +import { getAssetSettingsFromToml } from "./getAssetSettingsFromToml"; +import { normalizeAssetProps } from "./normalizeAssetProps"; +import { Asset } from "../types/types"; export const getAssetData = async ({ balances, diff --git a/src/helpers/getAssetFromHomeDomain.ts b/packages/demo-wallet-shared/helpers/getAssetFromHomeDomain.ts similarity index 92% rename from src/helpers/getAssetFromHomeDomain.ts rename to packages/demo-wallet-shared/helpers/getAssetFromHomeDomain.ts index 723886d8..80f7e830 100644 --- a/src/helpers/getAssetFromHomeDomain.ts +++ b/packages/demo-wallet-shared/helpers/getAssetFromHomeDomain.ts @@ -1,8 +1,8 @@ import { Asset } from "stellar-sdk"; import { Types } from "@stellar/wallet-sdk"; -import { checkAssetExists } from "helpers/checkAssetExists"; -import { getCurrenciesFromDomain } from "helpers/getCurrenciesFromDomain"; -import { getOverrideHomeDomain } from "helpers/getOverrideHomeDomain"; +import { checkAssetExists } from "./checkAssetExists"; +import { getCurrenciesFromDomain } from "./getCurrenciesFromDomain"; +import { getOverrideHomeDomain } from "./getOverrideHomeDomain"; const getAssetListString = (assetsArray: Asset[], key: "code" | "issuer") => assetsArray && assetsArray.length diff --git a/src/helpers/getAssetOverridesData.ts b/packages/demo-wallet-shared/helpers/getAssetOverridesData.ts similarity index 85% rename from src/helpers/getAssetOverridesData.ts rename to packages/demo-wallet-shared/helpers/getAssetOverridesData.ts index 1e7f0ece..93655d03 100644 --- a/src/helpers/getAssetOverridesData.ts +++ b/packages/demo-wallet-shared/helpers/getAssetOverridesData.ts @@ -1,8 +1,8 @@ import { Server } from "stellar-sdk"; -import { getAssetSettingsFromToml } from "helpers/getAssetSettingsFromToml"; -import { log } from "helpers/log"; -import { normalizeAssetProps } from "helpers/normalizeAssetProps"; -import { Asset, SearchParamAsset } from "types/types.d"; +import { getAssetSettingsFromToml } from "./getAssetSettingsFromToml"; +import { log } from "./log"; +import { normalizeAssetProps } from "./normalizeAssetProps"; +import { Asset, SearchParamAsset } from "../types/types"; type GetAssetOverridesDataProps = { assetOverrides: SearchParamAsset[]; diff --git a/src/helpers/getAssetSettingsFromToml.ts b/packages/demo-wallet-shared/helpers/getAssetSettingsFromToml.ts similarity index 93% rename from src/helpers/getAssetSettingsFromToml.ts rename to packages/demo-wallet-shared/helpers/getAssetSettingsFromToml.ts index 060b8d74..b1c78954 100644 --- a/src/helpers/getAssetSettingsFromToml.ts +++ b/packages/demo-wallet-shared/helpers/getAssetSettingsFromToml.ts @@ -1,6 +1,6 @@ import { Server } from "stellar-sdk"; -import { getToml } from "methods/getToml"; -import { AssetSupportedActions, AnyObject, AssetType } from "types/types.d"; +import { getToml } from "../methods/getToml"; +import { AssetSupportedActions, AnyObject, AssetType } from "../types/types"; interface GetAssetSettingsFromToml { assetId: string; diff --git a/src/helpers/getCurrenciesFromDomain.ts b/packages/demo-wallet-shared/helpers/getCurrenciesFromDomain.ts similarity index 92% rename from src/helpers/getCurrenciesFromDomain.ts rename to packages/demo-wallet-shared/helpers/getCurrenciesFromDomain.ts index c7f86c4b..271f027d 100644 --- a/src/helpers/getCurrenciesFromDomain.ts +++ b/packages/demo-wallet-shared/helpers/getCurrenciesFromDomain.ts @@ -1,5 +1,5 @@ import { Asset, StellarTomlResolver } from "stellar-sdk"; -import { normalizeHomeDomainUrl } from "helpers/normalizeHomeDomainUrl"; +import { normalizeHomeDomainUrl } from "./normalizeHomeDomainUrl"; export const getCurrenciesFromDomain = async ( homeDomain: string, diff --git a/src/helpers/getCurrentSessionParams.ts b/packages/demo-wallet-shared/helpers/getCurrentSessionParams.ts similarity index 90% rename from src/helpers/getCurrentSessionParams.ts rename to packages/demo-wallet-shared/helpers/getCurrentSessionParams.ts index 312f2736..b9b9b780 100644 --- a/src/helpers/getCurrentSessionParams.ts +++ b/packages/demo-wallet-shared/helpers/getCurrentSessionParams.ts @@ -1,4 +1,4 @@ -import { SearchParams } from "types/types.d"; +import { SearchParams } from "../types/types"; export const getCurrentSessionParams = () => { const sessionParams = [ diff --git a/src/helpers/getErrorMessage.ts b/packages/demo-wallet-shared/helpers/getErrorMessage.ts similarity index 100% rename from src/helpers/getErrorMessage.ts rename to packages/demo-wallet-shared/helpers/getErrorMessage.ts diff --git a/src/helpers/getErrorString.ts b/packages/demo-wallet-shared/helpers/getErrorString.ts similarity index 100% rename from src/helpers/getErrorString.ts rename to packages/demo-wallet-shared/helpers/getErrorString.ts diff --git a/src/helpers/getIssuerFromDomain.ts b/packages/demo-wallet-shared/helpers/getIssuerFromDomain.ts similarity index 88% rename from src/helpers/getIssuerFromDomain.ts rename to packages/demo-wallet-shared/helpers/getIssuerFromDomain.ts index 7c8bd9f7..da32fe56 100644 --- a/src/helpers/getIssuerFromDomain.ts +++ b/packages/demo-wallet-shared/helpers/getIssuerFromDomain.ts @@ -1,4 +1,4 @@ -import { getCurrenciesFromDomain } from "helpers/getCurrenciesFromDomain"; +import { getCurrenciesFromDomain } from "./getCurrenciesFromDomain"; export const getIssuerFromDomain = async ({ assetCode, diff --git a/src/helpers/getNetworkConfig.ts b/packages/demo-wallet-shared/helpers/getNetworkConfig.ts similarity index 92% rename from src/helpers/getNetworkConfig.ts rename to packages/demo-wallet-shared/helpers/getNetworkConfig.ts index 7b118799..16ce5971 100644 --- a/src/helpers/getNetworkConfig.ts +++ b/packages/demo-wallet-shared/helpers/getNetworkConfig.ts @@ -1,5 +1,5 @@ import StellarSdk from "stellar-sdk"; -import { NetworkType } from "types/types.d"; +import { NetworkType } from "../types/types"; interface NetworkItemConfig { network: string; diff --git a/src/helpers/getOverrideHomeDomain.ts b/packages/demo-wallet-shared/helpers/getOverrideHomeDomain.ts similarity index 95% rename from src/helpers/getOverrideHomeDomain.ts rename to packages/demo-wallet-shared/helpers/getOverrideHomeDomain.ts index 274d3729..e6a6a4ca 100644 --- a/src/helpers/getOverrideHomeDomain.ts +++ b/packages/demo-wallet-shared/helpers/getOverrideHomeDomain.ts @@ -1,5 +1,5 @@ import { Server } from "stellar-sdk"; -import { log } from "helpers/log"; +import { log } from "./log"; type GetOverrideHomeDomainProps = { assetIssuer: string; diff --git a/src/helpers/getPresetAssets.ts b/packages/demo-wallet-shared/helpers/getPresetAssets.ts similarity index 78% rename from src/helpers/getPresetAssets.ts rename to packages/demo-wallet-shared/helpers/getPresetAssets.ts index 62e5adff..80d14a00 100644 --- a/src/helpers/getPresetAssets.ts +++ b/packages/demo-wallet-shared/helpers/getPresetAssets.ts @@ -1,5 +1,5 @@ -import { PRESET_ASSETS } from "constants/presetAssets"; -import { Asset } from "types/types"; +import { PRESET_ASSETS } from "../constants/presetAssets"; +import { Asset } from "../types/types"; export const getPresetAssets = (allAssets: Asset[]) => { const newPresetAssets = PRESET_ASSETS.filter( diff --git a/src/helpers/getSep8NextStepOnSuccess.ts b/packages/demo-wallet-shared/helpers/getSep8NextStepOnSuccess.ts similarity index 97% rename from src/helpers/getSep8NextStepOnSuccess.ts rename to packages/demo-wallet-shared/helpers/getSep8NextStepOnSuccess.ts index 2dddd470..42932e55 100644 --- a/src/helpers/getSep8NextStepOnSuccess.ts +++ b/packages/demo-wallet-shared/helpers/getSep8NextStepOnSuccess.ts @@ -1,4 +1,4 @@ -import { Sep8ApprovalStatus, Sep8Step } from "types/types.d"; +import { Sep8ApprovalStatus, Sep8Step } from "../types/types"; /** * Returns the next SEP-8 step to be displayed after the current step succeeds. diff --git a/src/helpers/getUntrustedAssetData.ts b/packages/demo-wallet-shared/helpers/getUntrustedAssetData.ts similarity index 91% rename from src/helpers/getUntrustedAssetData.ts rename to packages/demo-wallet-shared/helpers/getUntrustedAssetData.ts index 9b950b77..5ed0ae70 100644 --- a/src/helpers/getUntrustedAssetData.ts +++ b/packages/demo-wallet-shared/helpers/getUntrustedAssetData.ts @@ -1,9 +1,9 @@ import { Server } from "stellar-sdk"; import { Types } from "@stellar/wallet-sdk"; -import { getAssetSettingsFromToml } from "helpers/getAssetSettingsFromToml"; -import { normalizeAssetProps } from "helpers/normalizeAssetProps"; -import { log } from "helpers/log"; -import { Asset } from "types/types.d"; +import { getAssetSettingsFromToml } from "./getAssetSettingsFromToml"; +import { normalizeAssetProps } from "./normalizeAssetProps"; +import { log } from "./log"; +import { Asset } from "../types/types"; interface GetUntrustedAssetDataProps { assetsToAdd: string[]; diff --git a/src/helpers/getValidatedUntrustedAsset.ts b/packages/demo-wallet-shared/helpers/getValidatedUntrustedAsset.ts similarity index 87% rename from src/helpers/getValidatedUntrustedAsset.ts rename to packages/demo-wallet-shared/helpers/getValidatedUntrustedAsset.ts index e197b626..4d343399 100644 --- a/src/helpers/getValidatedUntrustedAsset.ts +++ b/packages/demo-wallet-shared/helpers/getValidatedUntrustedAsset.ts @@ -1,8 +1,8 @@ import { Types } from "@stellar/wallet-sdk"; -import { checkAssetExists } from "helpers/checkAssetExists"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getAssetFromHomeDomain } from "helpers/getAssetFromHomeDomain"; -import { log } from "helpers/log"; +import { checkAssetExists } from "./checkAssetExists"; +import { getErrorMessage } from "./getErrorMessage"; +import { getAssetFromHomeDomain } from "./getAssetFromHomeDomain"; +import { log } from "./log"; interface GetUntrustedAssetProps { assetCode: string; diff --git a/src/helpers/isEmptyObject.ts b/packages/demo-wallet-shared/helpers/isEmptyObject.ts similarity index 100% rename from src/helpers/isEmptyObject.ts rename to packages/demo-wallet-shared/helpers/isEmptyObject.ts diff --git a/src/helpers/log.ts b/packages/demo-wallet-shared/helpers/log.ts similarity index 91% rename from src/helpers/log.ts rename to packages/demo-wallet-shared/helpers/log.ts index 662722a2..2ca9c3ae 100644 --- a/src/helpers/log.ts +++ b/packages/demo-wallet-shared/helpers/log.ts @@ -1,6 +1,6 @@ import { captureMessage as sentryCaptureMessage } from "@sentry/browser"; -import { LOG_MESSAGE_EVENT } from "constants/settings"; -import { LogType, LogItemProps, AnyObject } from "types/types.d"; +import { LOG_MESSAGE_EVENT } from "../constants/settings"; +import { LogType, LogItemProps, AnyObject } from "../types/types"; const dispatchLog = (detail: LogItemProps) => { document.dispatchEvent( diff --git a/src/helpers/normalizeAssetProps.ts b/packages/demo-wallet-shared/helpers/normalizeAssetProps.ts similarity index 98% rename from src/helpers/normalizeAssetProps.ts rename to packages/demo-wallet-shared/helpers/normalizeAssetProps.ts index cd904353..eacf4431 100644 --- a/src/helpers/normalizeAssetProps.ts +++ b/packages/demo-wallet-shared/helpers/normalizeAssetProps.ts @@ -4,7 +4,7 @@ import { AssetSupportedActions, AnyObject, AssetType, -} from "types/types.d"; +} from "../types/types"; interface NormalizeAssetProps { source?: Types.AssetBalance | Types.NativeBalance; diff --git a/src/helpers/normalizeHomeDomainUrl.ts b/packages/demo-wallet-shared/helpers/normalizeHomeDomainUrl.ts similarity index 100% rename from src/helpers/normalizeHomeDomainUrl.ts rename to packages/demo-wallet-shared/helpers/normalizeHomeDomainUrl.ts diff --git a/src/helpers/sanitizeHtml.ts b/packages/demo-wallet-shared/helpers/sanitizeHtml.ts similarity index 100% rename from src/helpers/sanitizeHtml.ts rename to packages/demo-wallet-shared/helpers/sanitizeHtml.ts diff --git a/src/helpers/searchKeyPairStringToArray.ts b/packages/demo-wallet-shared/helpers/searchKeyPairStringToArray.ts similarity index 87% rename from src/helpers/searchKeyPairStringToArray.ts rename to packages/demo-wallet-shared/helpers/searchKeyPairStringToArray.ts index 8c560bc6..dba05636 100644 --- a/src/helpers/searchKeyPairStringToArray.ts +++ b/packages/demo-wallet-shared/helpers/searchKeyPairStringToArray.ts @@ -1,5 +1,5 @@ -import { URL_KEY_PAIR_SEPARATOR_CHAR } from "constants/settings"; -import { SearchParamAsset } from "types/types.d"; +import { URL_KEY_PAIR_SEPARATOR_CHAR } from "../constants/settings"; +import { SearchParamAsset } from "../types/types"; // eslint-disable-next-line max-len // keyPairsString example:SRT:GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B|homeDomain>testanchor.stellar.org|someKey>someValue diff --git a/src/helpers/searchParam.ts b/packages/demo-wallet-shared/helpers/searchParam.ts similarity index 96% rename from src/helpers/searchParam.ts rename to packages/demo-wallet-shared/helpers/searchParam.ts index 649c6f54..cac91ba2 100644 --- a/src/helpers/searchParam.ts +++ b/packages/demo-wallet-shared/helpers/searchParam.ts @@ -1,9 +1,9 @@ import { URL_ITEM_SEPARATOR_CHAR, URL_KEY_PAIR_SEPARATOR_CHAR, -} from "constants/settings"; -import { searchKeyPairStringToArray } from "helpers/searchKeyPairStringToArray"; -import { SearchParams, SearchParamAsset, StringObject } from "types/types.d"; +} from "../constants/settings"; +import { searchKeyPairStringToArray } from "./searchKeyPairStringToArray"; +import { SearchParams, SearchParamAsset, StringObject } from "../types/types"; const update = ( param: SearchParams, diff --git a/src/helpers/shortenStellarKey.ts b/packages/demo-wallet-shared/helpers/shortenStellarKey.ts similarity index 100% rename from src/helpers/shortenStellarKey.ts rename to packages/demo-wallet-shared/helpers/shortenStellarKey.ts diff --git a/src/helpers/updateAssetsInStore.ts b/packages/demo-wallet-shared/helpers/updateAssetsInStore.ts similarity index 86% rename from src/helpers/updateAssetsInStore.ts rename to packages/demo-wallet-shared/helpers/updateAssetsInStore.ts index 6ee942cb..c48ebb0a 100644 --- a/src/helpers/updateAssetsInStore.ts +++ b/packages/demo-wallet-shared/helpers/updateAssetsInStore.ts @@ -1,4 +1,4 @@ -import { Asset, SearchParamAsset } from "types/types.d"; +import { Asset, SearchParamAsset } from "../types/types"; export const updateAssetsInStore = ( currentAssets: Asset[], diff --git a/src/methods/checkDepositWithdrawInfo.ts b/packages/demo-wallet-shared/methods/checkDepositWithdrawInfo.ts similarity index 88% rename from src/methods/checkDepositWithdrawInfo.ts rename to packages/demo-wallet-shared/methods/checkDepositWithdrawInfo.ts index 88d4184c..919807ab 100644 --- a/src/methods/checkDepositWithdrawInfo.ts +++ b/packages/demo-wallet-shared/methods/checkDepositWithdrawInfo.ts @@ -1,6 +1,6 @@ import { get } from "lodash"; -import { log } from "helpers/log"; -import { CheckInfoData, AnchorActionType } from "types/types.d"; +import { log } from "../helpers/log"; +import { CheckInfoData, AnchorActionType } from "../types/types"; export const checkDepositWithdrawInfo = async ({ type, diff --git a/src/methods/checkTomlForFields.ts b/packages/demo-wallet-shared/methods/checkTomlForFields.ts similarity index 84% rename from src/methods/checkTomlForFields.ts rename to packages/demo-wallet-shared/methods/checkTomlForFields.ts index 18666c59..070c2dfb 100644 --- a/src/methods/checkTomlForFields.ts +++ b/packages/demo-wallet-shared/methods/checkTomlForFields.ts @@ -1,7 +1,7 @@ -import { log } from "helpers/log"; -import { getHomeDomainFromAssetIssuer } from "methods/getHomeDomainFromAssetIssuer"; -import { getToml } from "methods/getToml"; -import { TomlFields, AnyObject } from "types/types.d"; +import { log } from "../helpers/log"; +import { getHomeDomainFromAssetIssuer } from "./getHomeDomainFromAssetIssuer"; +import { getToml } from "./getToml"; +import { TomlFields, AnyObject } from "../types/types"; export const checkTomlForFields = async ({ sepName, diff --git a/src/methods/claimClaimableBalance.ts b/packages/demo-wallet-shared/methods/claimClaimableBalance.ts similarity index 93% rename from src/methods/claimClaimableBalance.ts rename to packages/demo-wallet-shared/methods/claimClaimableBalance.ts index b8f48571..a2d499d0 100644 --- a/src/methods/claimClaimableBalance.ts +++ b/packages/demo-wallet-shared/methods/claimClaimableBalance.ts @@ -4,9 +4,9 @@ import StellarSdk, { Operation, TransactionBuilder, } from "stellar-sdk"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { log } from "helpers/log"; -import { ClaimableAsset } from "types/types.d"; +import { getErrorMessage } from "../helpers/getErrorMessage"; +import { log } from "../helpers/log"; +import { ClaimableAsset } from "../types/types"; interface ClaimClaimableBalanceProps { secretKey: string; diff --git a/src/methods/createMemoFromType.ts b/packages/demo-wallet-shared/methods/createMemoFromType.ts similarity index 100% rename from src/methods/createMemoFromType.ts rename to packages/demo-wallet-shared/methods/createMemoFromType.ts diff --git a/src/methods/getHomeDomainFromAssetIssuer.ts b/packages/demo-wallet-shared/methods/getHomeDomainFromAssetIssuer.ts similarity index 95% rename from src/methods/getHomeDomainFromAssetIssuer.ts rename to packages/demo-wallet-shared/methods/getHomeDomainFromAssetIssuer.ts index 83455fda..ca4474df 100644 --- a/src/methods/getHomeDomainFromAssetIssuer.ts +++ b/packages/demo-wallet-shared/methods/getHomeDomainFromAssetIssuer.ts @@ -1,5 +1,5 @@ import StellarSdk from "stellar-sdk"; -import { log } from "helpers/log"; +import { log } from "../helpers/log"; export const getHomeDomainFromAssetIssuer = async ({ assetIssuer, diff --git a/src/methods/getToml.ts b/packages/demo-wallet-shared/methods/getToml.ts similarity index 85% rename from src/methods/getToml.ts rename to packages/demo-wallet-shared/methods/getToml.ts index 07d93f7f..90d72bed 100644 --- a/src/methods/getToml.ts +++ b/packages/demo-wallet-shared/methods/getToml.ts @@ -1,5 +1,5 @@ import { StellarTomlResolver } from "stellar-sdk"; -import { normalizeHomeDomainUrl } from "helpers/normalizeHomeDomainUrl"; +import { normalizeHomeDomainUrl } from "../helpers/normalizeHomeDomainUrl"; export const getToml = async (homeDomain: string) => { const tomlURL = normalizeHomeDomainUrl(homeDomain); diff --git a/src/methods/sep10Auth/index.ts b/packages/demo-wallet-shared/methods/sep10Auth/index.ts similarity index 100% rename from src/methods/sep10Auth/index.ts rename to packages/demo-wallet-shared/methods/sep10Auth/index.ts diff --git a/src/methods/sep10Auth/send.ts b/packages/demo-wallet-shared/methods/sep10Auth/send.ts similarity index 95% rename from src/methods/sep10Auth/send.ts rename to packages/demo-wallet-shared/methods/sep10Auth/send.ts index 94b8c790..d12fc9aa 100644 --- a/src/methods/sep10Auth/send.ts +++ b/packages/demo-wallet-shared/methods/sep10Auth/send.ts @@ -1,4 +1,4 @@ -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; export const send = async ({ authEndpoint, diff --git a/packages/demo-wallet-shared/methods/sep10Auth/sign.ts b/packages/demo-wallet-shared/methods/sep10Auth/sign.ts new file mode 100644 index 00000000..b5ad2925 --- /dev/null +++ b/packages/demo-wallet-shared/methods/sep10Auth/sign.ts @@ -0,0 +1,58 @@ +import { Keypair, Transaction } from "stellar-sdk"; +import { log } from "../../helpers/log"; + +export const sign = async ({ + challengeTransaction, + networkPassphrase, + secretKey, + walletBackendEndpoint, +}: { + challengeTransaction: Transaction; + networkPassphrase: string; + secretKey: string; + walletBackendEndpoint: string; +}) => { + log.instruction({ + title: + "We’ve received a challenge transaction from the server that we need the sending anchor to sign with their Stellar private key", + }); + + for (const op of challengeTransaction.operations) { + if (op.type === "manageData" && op.name === "client_domain") { + // The anchor server supports client attribution, get a signature from the demo wallet backend server + log.instruction({title: "anchor supports SEP-10 client attribution, requesting signature from demo wallet backend..."}); + const params = { + transaction: challengeTransaction.toEnvelope().toXDR("base64"), + network_passphrase: networkPassphrase + }; + log.request({ title: "POST `/sign`", body: params }); + const urlParams = new URLSearchParams(params); + const walletBackendSignEndpoint = `${walletBackendEndpoint}/sign`; + + const result = await fetch(walletBackendSignEndpoint, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + body: urlParams.toString(), + }); + const resultJson = await result.json(); + log.response({ title: "POST `/sign`", body: resultJson }); + challengeTransaction = new Transaction(resultJson.transaction, resultJson.network_passphrase); + log.instruction({title: "challenge signed by demo wallet backend"}); + break; + } + } + + const envelope = challengeTransaction.toEnvelope().toXDR("base64"); + const transaction = new Transaction(envelope, networkPassphrase); + transaction.sign(Keypair.fromSecret(secretKey)); + + log.instruction({ title: "SEP-10 signed transaction", body: transaction }); + log.instruction({ + title: "SEP-10 signed transaction, `base64` encoded", + body: transaction.toEnvelope().toXDR("base64"), + }); + + return transaction; +}; \ No newline at end of file diff --git a/src/methods/sep10Auth/start.ts b/packages/demo-wallet-shared/methods/sep10Auth/start.ts similarity index 85% rename from src/methods/sep10Auth/start.ts rename to packages/demo-wallet-shared/methods/sep10Auth/start.ts index db6417c4..784c1c7b 100644 --- a/src/methods/sep10Auth/start.ts +++ b/packages/demo-wallet-shared/methods/sep10Auth/start.ts @@ -1,18 +1,20 @@ import { Utils } from "stellar-sdk"; -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; export const start = async ({ authEndpoint, serverSigningKey, publicKey, homeDomain, + clientDomain, }: { authEndpoint: string; serverSigningKey: string; publicKey: string; homeDomain: string; + clientDomain: string; }) => { - const params = { account: publicKey, home_domain: homeDomain }; + const params = { account: publicKey, home_domain: homeDomain, client_domain: clientDomain }; log.instruction({ title: diff --git a/src/methods/sep12/collectSep12Fields.ts b/packages/demo-wallet-shared/methods/sep12/collectSep12Fields.ts similarity index 94% rename from src/methods/sep12/collectSep12Fields.ts rename to packages/demo-wallet-shared/methods/sep12/collectSep12Fields.ts index 86633637..b302ff1b 100644 --- a/src/methods/sep12/collectSep12Fields.ts +++ b/packages/demo-wallet-shared/methods/sep12/collectSep12Fields.ts @@ -1,5 +1,8 @@ -import { log } from "helpers/log"; -import { Sep12CustomerStatus, Sep12CustomerFieldStatus } from "types/types.d"; +import { log } from "../../helpers/log"; +import { + Sep12CustomerStatus, + Sep12CustomerFieldStatus, +} from "../../types/types"; export const collectSep12Fields = async ({ kycServer, diff --git a/src/methods/sep12/index.ts b/packages/demo-wallet-shared/methods/sep12/index.ts similarity index 100% rename from src/methods/sep12/index.ts rename to packages/demo-wallet-shared/methods/sep12/index.ts diff --git a/src/methods/sep12/putSep12FieldsRequest.ts b/packages/demo-wallet-shared/methods/sep12/putSep12FieldsRequest.ts similarity index 97% rename from src/methods/sep12/putSep12FieldsRequest.ts rename to packages/demo-wallet-shared/methods/sep12/putSep12FieldsRequest.ts index 8ee81f83..e32bc701 100644 --- a/src/methods/sep12/putSep12FieldsRequest.ts +++ b/packages/demo-wallet-shared/methods/sep12/putSep12FieldsRequest.ts @@ -1,5 +1,5 @@ import { Keypair } from "stellar-sdk"; -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; interface PutSep12FieldsRequestProps { secretKey: string; diff --git a/src/methods/sep24/checkInfo.ts b/packages/demo-wallet-shared/methods/sep24/checkInfo.ts similarity index 88% rename from src/methods/sep24/checkInfo.ts rename to packages/demo-wallet-shared/methods/sep24/checkInfo.ts index d8634496..2b34e3b9 100644 --- a/src/methods/sep24/checkInfo.ts +++ b/packages/demo-wallet-shared/methods/sep24/checkInfo.ts @@ -1,6 +1,6 @@ import { get } from "lodash"; -import { log } from "helpers/log"; -import { AnchorActionType } from "types/types.d"; +import { log } from "../../helpers/log"; +import { AnchorActionType } from "../../types/types"; export const checkInfo = async ({ type, diff --git a/src/methods/sep24/createPopup.ts b/packages/demo-wallet-shared/methods/sep24/createPopup.ts similarity index 100% rename from src/methods/sep24/createPopup.ts rename to packages/demo-wallet-shared/methods/sep24/createPopup.ts diff --git a/src/methods/sep24/index.ts b/packages/demo-wallet-shared/methods/sep24/index.ts similarity index 100% rename from src/methods/sep24/index.ts rename to packages/demo-wallet-shared/methods/sep24/index.ts diff --git a/src/methods/sep24/interactiveDepositFlow.ts b/packages/demo-wallet-shared/methods/sep24/interactiveDepositFlow.ts similarity index 97% rename from src/methods/sep24/interactiveDepositFlow.ts rename to packages/demo-wallet-shared/methods/sep24/interactiveDepositFlow.ts index 4d1ac077..69edf48a 100644 --- a/src/methods/sep24/interactiveDepositFlow.ts +++ b/packages/demo-wallet-shared/methods/sep24/interactiveDepositFlow.ts @@ -1,5 +1,5 @@ import { each } from "lodash"; -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; type InteractiveDepositFlowProps = { assetCode: string; diff --git a/src/methods/sep24/interactiveWithdrawFlow.ts b/packages/demo-wallet-shared/methods/sep24/interactiveWithdrawFlow.ts similarity index 96% rename from src/methods/sep24/interactiveWithdrawFlow.ts rename to packages/demo-wallet-shared/methods/sep24/interactiveWithdrawFlow.ts index 98bb15dc..d07a9c20 100644 --- a/src/methods/sep24/interactiveWithdrawFlow.ts +++ b/packages/demo-wallet-shared/methods/sep24/interactiveWithdrawFlow.ts @@ -1,5 +1,5 @@ import { each } from "lodash"; -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; export const interactiveWithdrawFlow = async ({ assetCode, diff --git a/src/methods/sep24/pollDepositUntilComplete.ts b/packages/demo-wallet-shared/methods/sep24/pollDepositUntilComplete.ts similarity index 95% rename from src/methods/sep24/pollDepositUntilComplete.ts rename to packages/demo-wallet-shared/methods/sep24/pollDepositUntilComplete.ts index 0ca99c0b..2b010ff4 100644 --- a/src/methods/sep24/pollDepositUntilComplete.ts +++ b/packages/demo-wallet-shared/methods/sep24/pollDepositUntilComplete.ts @@ -1,6 +1,6 @@ -import { getErrorMessage } from "helpers/getErrorMessage"; -import { log } from "helpers/log"; -import { TransactionStatus } from "types/types.d"; +import { getErrorMessage } from "../../helpers/getErrorMessage"; +import { log } from "../../helpers/log"; +import { TransactionStatus } from "../../types/types"; export const pollDepositUntilComplete = async ({ popup, diff --git a/src/methods/sep24/pollWithdrawUntilComplete.ts b/packages/demo-wallet-shared/methods/sep24/pollWithdrawUntilComplete.ts similarity index 97% rename from src/methods/sep24/pollWithdrawUntilComplete.ts rename to packages/demo-wallet-shared/methods/sep24/pollWithdrawUntilComplete.ts index 5fd91574..14ba1294 100644 --- a/src/methods/sep24/pollWithdrawUntilComplete.ts +++ b/packages/demo-wallet-shared/methods/sep24/pollWithdrawUntilComplete.ts @@ -6,9 +6,9 @@ import StellarSdk, { Operation, TransactionBuilder, } from "stellar-sdk"; -import { log } from "helpers/log"; -import { createMemoFromType } from "methods/createMemoFromType"; -import { TransactionStatus } from "types/types.d"; +import { log } from "../../helpers/log"; +import { createMemoFromType } from "../createMemoFromType"; +import { TransactionStatus } from "../../types/types"; export const pollWithdrawUntilComplete = async ({ secretKey, diff --git a/src/methods/sep31Send/checkInfo.ts b/packages/demo-wallet-shared/methods/sep31Send/checkInfo.ts similarity index 97% rename from src/methods/sep31Send/checkInfo.ts rename to packages/demo-wallet-shared/methods/sep31Send/checkInfo.ts index 5c081965..8481d669 100644 --- a/src/methods/sep31Send/checkInfo.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/checkInfo.ts @@ -1,5 +1,5 @@ -import { isEmptyObject } from "helpers/isEmptyObject"; -import { log } from "helpers/log"; +import { isEmptyObject } from "../../helpers/isEmptyObject"; +import { log } from "../../helpers/log"; export const checkInfo = async ({ assetCode, diff --git a/src/methods/sep31Send/getSep12Fields.ts b/packages/demo-wallet-shared/methods/sep31Send/getSep12Fields.ts similarity index 96% rename from src/methods/sep31Send/getSep12Fields.ts rename to packages/demo-wallet-shared/methods/sep31Send/getSep12Fields.ts index 22a56c97..8ec9dee4 100644 --- a/src/methods/sep31Send/getSep12Fields.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/getSep12Fields.ts @@ -1,5 +1,5 @@ import crypto from "crypto"; -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; import { collectSep12Fields } from "../sep12/collectSep12Fields"; export const getSep12Fields = async ({ diff --git a/src/methods/sep31Send/index.ts b/packages/demo-wallet-shared/methods/sep31Send/index.ts similarity index 100% rename from src/methods/sep31Send/index.ts rename to packages/demo-wallet-shared/methods/sep31Send/index.ts diff --git a/src/methods/sep31Send/pollTransactionUntilComplete.ts b/packages/demo-wallet-shared/methods/sep31Send/pollTransactionUntilComplete.ts similarity index 96% rename from src/methods/sep31Send/pollTransactionUntilComplete.ts rename to packages/demo-wallet-shared/methods/sep31Send/pollTransactionUntilComplete.ts index bc6795b4..dfb6d073 100644 --- a/src/methods/sep31Send/pollTransactionUntilComplete.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/pollTransactionUntilComplete.ts @@ -1,5 +1,5 @@ -import { log } from "helpers/log"; -import { TransactionStatus } from "types/types.d"; +import { log } from "../../helpers/log"; +import { TransactionStatus } from "../../types/types"; export const pollTransactionUntilComplete = async ({ sendServer, diff --git a/src/methods/sep31Send/pollTransactionUntilReady.ts b/packages/demo-wallet-shared/methods/sep31Send/pollTransactionUntilReady.ts similarity index 92% rename from src/methods/sep31Send/pollTransactionUntilReady.ts rename to packages/demo-wallet-shared/methods/sep31Send/pollTransactionUntilReady.ts index 882c8ea2..7c0d98e6 100644 --- a/src/methods/sep31Send/pollTransactionUntilReady.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/pollTransactionUntilReady.ts @@ -1,5 +1,5 @@ -import { log } from "helpers/log"; -import { TransactionStatus } from "types/types.d"; +import { log } from "../../helpers/log"; +import { TransactionStatus } from "../../types/types"; export const pollTransactionUntilReady = async ({ sendServer, diff --git a/src/methods/sep31Send/postTransaction.ts b/packages/demo-wallet-shared/methods/sep31Send/postTransaction.ts similarity index 97% rename from src/methods/sep31Send/postTransaction.ts rename to packages/demo-wallet-shared/methods/sep31Send/postTransaction.ts index 9268f7b8..738808ad 100644 --- a/src/methods/sep31Send/postTransaction.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/postTransaction.ts @@ -1,4 +1,4 @@ -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; interface PostTransactionProps { token: string; diff --git a/src/methods/sep31Send/putSep12Fields.ts b/packages/demo-wallet-shared/methods/sep31Send/putSep12Fields.ts similarity index 96% rename from src/methods/sep31Send/putSep12Fields.ts rename to packages/demo-wallet-shared/methods/sep31Send/putSep12Fields.ts index f3ace377..0c89336f 100644 --- a/src/methods/sep31Send/putSep12Fields.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/putSep12Fields.ts @@ -1,4 +1,4 @@ -import { log } from "helpers/log"; +import { log } from "../../helpers/log"; import { putSep12FieldsRequest } from "../sep12"; diff --git a/src/methods/sep31Send/sendPayment.ts b/packages/demo-wallet-shared/methods/sep31Send/sendPayment.ts similarity index 97% rename from src/methods/sep31Send/sendPayment.ts rename to packages/demo-wallet-shared/methods/sep31Send/sendPayment.ts index b43b3474..9fc9a377 100644 --- a/src/methods/sep31Send/sendPayment.ts +++ b/packages/demo-wallet-shared/methods/sep31Send/sendPayment.ts @@ -9,8 +9,8 @@ import { Server, TransactionBuilder, } from "stellar-sdk"; -import { log } from "helpers/log"; -import { MemoTypeString } from "types/types.d"; +import { log } from "../../helpers/log"; +import { MemoTypeString } from "../../types/types"; interface SendPaymentProps { secretKey: string; diff --git a/src/methods/sep6/index.ts b/packages/demo-wallet-shared/methods/sep6/index.ts similarity index 100% rename from src/methods/sep6/index.ts rename to packages/demo-wallet-shared/methods/sep6/index.ts diff --git a/src/methods/sep6/pollDepositUntilComplete.ts b/packages/demo-wallet-shared/methods/sep6/pollDepositUntilComplete.ts similarity index 95% rename from src/methods/sep6/pollDepositUntilComplete.ts rename to packages/demo-wallet-shared/methods/sep6/pollDepositUntilComplete.ts index ed883dba..39a8b052 100644 --- a/src/methods/sep6/pollDepositUntilComplete.ts +++ b/packages/demo-wallet-shared/methods/sep6/pollDepositUntilComplete.ts @@ -1,6 +1,6 @@ -import { getErrorMessage } from "helpers/getErrorMessage"; -import { log } from "helpers/log"; -import { TransactionStatus } from "types/types.d"; +import { getErrorMessage } from "../../helpers/getErrorMessage"; +import { log } from "../../helpers/log"; +import { TransactionStatus } from "../../types/types"; export const pollDepositUntilComplete = async ({ transactionId, diff --git a/src/methods/sep6/pollWithdrawUntilComplete.ts b/packages/demo-wallet-shared/methods/sep6/pollWithdrawUntilComplete.ts similarity index 96% rename from src/methods/sep6/pollWithdrawUntilComplete.ts rename to packages/demo-wallet-shared/methods/sep6/pollWithdrawUntilComplete.ts index 136ccff4..7fc7c1d7 100644 --- a/src/methods/sep6/pollWithdrawUntilComplete.ts +++ b/packages/demo-wallet-shared/methods/sep6/pollWithdrawUntilComplete.ts @@ -6,9 +6,9 @@ import StellarSdk, { Operation, TransactionBuilder, } from "stellar-sdk"; -import { log } from "helpers/log"; -import { createMemoFromType } from "methods/createMemoFromType"; -import { AnyObject, TransactionStatus } from "types/types.d"; +import { log } from "../../helpers/log"; +import { createMemoFromType } from "../createMemoFromType"; +import { AnyObject, TransactionStatus } from "../../types/types"; export const pollWithdrawUntilComplete = async ({ amount, diff --git a/src/methods/sep6/programmaticDepositFlow.ts b/packages/demo-wallet-shared/methods/sep6/programmaticDepositFlow.ts similarity index 94% rename from src/methods/sep6/programmaticDepositFlow.ts rename to packages/demo-wallet-shared/methods/sep6/programmaticDepositFlow.ts index 776feedf..b308bf10 100644 --- a/src/methods/sep6/programmaticDepositFlow.ts +++ b/packages/demo-wallet-shared/methods/sep6/programmaticDepositFlow.ts @@ -1,6 +1,6 @@ import { each } from "lodash"; -import { log } from "helpers/log"; -import { AnyObject } from "types/types"; +import { log } from "../../helpers/log"; +import { AnyObject } from "../../types/types"; type ProgrammaticDepositFlowProps = { amount?: string; diff --git a/src/methods/sep6/programmaticWithdrawFlow.ts b/packages/demo-wallet-shared/methods/sep6/programmaticWithdrawFlow.ts similarity index 94% rename from src/methods/sep6/programmaticWithdrawFlow.ts rename to packages/demo-wallet-shared/methods/sep6/programmaticWithdrawFlow.ts index d96b82b9..0b95d18f 100644 --- a/src/methods/sep6/programmaticWithdrawFlow.ts +++ b/packages/demo-wallet-shared/methods/sep6/programmaticWithdrawFlow.ts @@ -1,6 +1,6 @@ import { each } from "lodash"; -import { log } from "helpers/log"; -import { AnyObject } from "types/types"; +import { log } from "../../helpers/log"; +import { AnyObject } from "../../types/types"; type ProgrammaticWithdrawFlowProps = { assetCode: string; diff --git a/src/methods/sep8Send/revisePaymentTransaction.ts b/packages/demo-wallet-shared/methods/sep8Send/revisePaymentTransaction.ts similarity index 91% rename from src/methods/sep8Send/revisePaymentTransaction.ts rename to packages/demo-wallet-shared/methods/sep8Send/revisePaymentTransaction.ts index 1fbc659b..b5c00efc 100644 --- a/src/methods/sep8Send/revisePaymentTransaction.ts +++ b/packages/demo-wallet-shared/methods/sep8Send/revisePaymentTransaction.ts @@ -1,14 +1,14 @@ import StellarSdk, { Transaction } from "stellar-sdk"; -import { getErrorString } from "helpers/getErrorString"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { Sep9Field, Sep9FieldsDict } from "helpers/Sep9Fields"; -import { buildPaymentTransaction } from "methods/submitPaymentTransaction"; +import { getErrorString } from "../../helpers/getErrorString"; +import { getNetworkConfig } from "../../helpers/getNetworkConfig"; +import { log } from "../../helpers/log"; +import { Sep9Field, Sep9FieldsDict } from "../../helpers/Sep9Fields"; +import { buildPaymentTransaction } from "../submitPaymentTransaction"; import { Sep8ApprovalResponse, Sep8ApprovalStatus, Sep8PaymentTransactionParams, -} from "types/types.d"; +} from "../../types/types"; export const revisePaymentTransaction = async ({ isPubnet, diff --git a/src/methods/sep8Send/sendActionRequiredFields.ts b/packages/demo-wallet-shared/methods/sep8Send/sendActionRequiredFields.ts similarity index 94% rename from src/methods/sep8Send/sendActionRequiredFields.ts rename to packages/demo-wallet-shared/methods/sep8Send/sendActionRequiredFields.ts index 4793648a..acefa225 100644 --- a/src/methods/sep8Send/sendActionRequiredFields.ts +++ b/packages/demo-wallet-shared/methods/sep8Send/sendActionRequiredFields.ts @@ -1,10 +1,10 @@ -import { log } from "helpers/log"; -import { Sep9FieldsDict, Sep9FieldType } from "helpers/Sep9Fields"; +import { log } from "../../helpers/log"; +import { Sep9FieldsDict, Sep9FieldType } from "../../helpers/Sep9Fields"; import { Sep8ActionRequiredResultType, Sep8ActionRequiredSendParams, Sep8ActionRequiredSentResult, -} from "types/types.d"; +} from "../../types/types"; export const sendActionRequiredFields = async ({ actionFields, diff --git a/src/methods/sep8Send/submitRevisedTransaction.ts b/packages/demo-wallet-shared/methods/sep8Send/submitRevisedTransaction.ts similarity index 88% rename from src/methods/sep8Send/submitRevisedTransaction.ts rename to packages/demo-wallet-shared/methods/sep8Send/submitRevisedTransaction.ts index 92c2557d..9e3b29fd 100644 --- a/src/methods/sep8Send/submitRevisedTransaction.ts +++ b/packages/demo-wallet-shared/methods/sep8Send/submitRevisedTransaction.ts @@ -4,9 +4,9 @@ import StellarSdk, { Transaction, TransactionBuilder, } from "stellar-sdk"; -import { getErrorString } from "helpers/getErrorString"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; +import { getErrorString } from "../../helpers/getErrorString"; +import { getNetworkConfig } from "../../helpers/getNetworkConfig"; +import { log } from "../../helpers/log"; export const submitRevisedTransaction = async ({ amount, diff --git a/src/methods/submitPaymentTransaction.ts b/packages/demo-wallet-shared/methods/submitPaymentTransaction.ts similarity index 91% rename from src/methods/submitPaymentTransaction.ts rename to packages/demo-wallet-shared/methods/submitPaymentTransaction.ts index fb5a0329..bcbb3f5e 100644 --- a/src/methods/submitPaymentTransaction.ts +++ b/packages/demo-wallet-shared/methods/submitPaymentTransaction.ts @@ -1,9 +1,9 @@ import StellarSdk, { BASE_FEE, Keypair } from "stellar-sdk"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { getErrorString } from "helpers/getErrorString"; -import { getNetworkConfig } from "helpers/getNetworkConfig"; -import { log } from "helpers/log"; -import { PaymentTransactionParams } from "types/types.d"; +import { getErrorMessage } from "../helpers/getErrorMessage"; +import { getErrorString } from "../helpers/getErrorString"; +import { getNetworkConfig } from "../helpers/getNetworkConfig"; +import { log } from "../helpers/log"; +import { PaymentTransactionParams } from "../types/types"; export const submitPaymentTransaction = async ({ isPubnet, diff --git a/src/methods/trustAsset.ts b/packages/demo-wallet-shared/methods/trustAsset.ts similarity index 92% rename from src/methods/trustAsset.ts rename to packages/demo-wallet-shared/methods/trustAsset.ts index 8e62a9d0..f1bd06b8 100644 --- a/src/methods/trustAsset.ts +++ b/packages/demo-wallet-shared/methods/trustAsset.ts @@ -5,9 +5,9 @@ import StellarSdk, { Asset, Keypair, } from "stellar-sdk"; -import { getErrorMessage } from "helpers/getErrorMessage"; -import { log } from "helpers/log"; -import { TrustAssetParam } from "types/types.d"; +import { getErrorMessage } from "../helpers/getErrorMessage"; +import { log } from "../helpers/log"; +import { TrustAssetParam } from "../types/types"; export const trustAsset = async ({ secretKey, diff --git a/packages/demo-wallet-shared/package.json b/packages/demo-wallet-shared/package.json new file mode 100644 index 00000000..87ad3cac --- /dev/null +++ b/packages/demo-wallet-shared/package.json @@ -0,0 +1,28 @@ +{ + "name": "demo-wallet-shared", + "version": "1.0.0", + "private": true, + "scripts": { + "clean": "rimraf ./build", + "build:tsc": "yarn clean && tsc -p tsconfig.json", + "build": "yarn build:tsc", + "watch:tsc": "tsc -w -p tsconfig.json", + "start": "yarn clean && yarn watch:tsc" + }, + "dependencies": { + "@stellar/frontend-helpers": "^2.1.3", + "@stellar/prettier-config": "^1.0.1", + "@stellar/wallet-sdk": "^0.5.0-rc.0", + "bignumber.js": "^9.0.1", + "crypto": "^1.0.1", + "dompurify": "^2.3.3", + "html-react-parser": "^1.4.0", + "lodash": "^4.17.21", + "marked": "^3.0.4", + "rimraf": "^3.0.2", + "stellar-sdk": "^9.1.0", + "toml": "^3.0.0", + "tslib": "^2.3.1", + "typescript": "~4.4.3" + } +} diff --git a/packages/demo-wallet-shared/tsconfig.json b/packages/demo-wallet-shared/tsconfig.json new file mode 100644 index 00000000..68fcff9c --- /dev/null +++ b/packages/demo-wallet-shared/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationDir": "build", + "moduleResolution": "node", + "outDir": "build", + "jsx": "react-jsx", + "allowJs": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "isolatedModules": true + }, + "exclude": ["node_modules", "build"] +} diff --git a/packages/demo-wallet-shared/types/@modules.d.ts b/packages/demo-wallet-shared/types/@modules.d.ts new file mode 100644 index 00000000..cf42ec3b --- /dev/null +++ b/packages/demo-wallet-shared/types/@modules.d.ts @@ -0,0 +1 @@ +declare module "dompurify"; diff --git a/packages/demo-wallet-shared/types/types.ts b/packages/demo-wallet-shared/types/types.ts new file mode 100644 index 00000000..409265fd --- /dev/null +++ b/packages/demo-wallet-shared/types/types.ts @@ -0,0 +1,557 @@ +import React, { ReactNode } from "react"; +import { Horizon } from "stellar-sdk"; +import { Types } from "@stellar/wallet-sdk"; +import { Sep9Field } from "../helpers/Sep9Fields"; + +export enum SearchParams { + SECRET_KEY = "secretKey", + PUBNET = "pubnet", + UNTRUSTED_ASSETS = "untrustedAssets", + ASSET_OVERRIDES = "assetOverrides", + CLAIMABLE_BALANCE_SUPPORTED = "claimableBalanceSupported", +} + +export enum AssetCategory { + TRUSTED = "trusted", + UNTRUSTED = "untrusted", +} + +export enum TomlFields { + ACCOUNTS = "ACCOUNTS", + AUTH_SERVER = "AUTH_SERVER", + DIRECT_PAYMENT_SERVER = "DIRECT_PAYMENT_SERVER", + FEDERATION_SERVER = "FEDERATION_SERVER", + HORIZON_URL = "HORIZON_URL", + KYC_SERVER = "KYC_SERVER", + NETWORK_PASSPHRASE = "NETWORK_PASSPHRASE", + SIGNING_KEY = "SIGNING_KEY", + TRANSFER_SERVER = "TRANSFER_SERVER", + TRANSFER_SERVER_SEP0024 = "TRANSFER_SERVER_SEP0024", + URI_REQUEST_SIGNING_KEY = "URI_REQUEST_SIGNING_KEY", + VERSION = "VERSION", + WEB_AUTH_ENDPOINT = "WEB_AUTH_ENDPOINT", +} + +export interface presetAsset { + assetCode: string; + homeDomain?: string; + issuerPublicKey?: string; +} + +export interface Asset { + assetString: string; + assetCode: string; + assetIssuer: string; + assetType: string; + total: string; + homeDomain?: string; + supportedActions?: AssetSupportedActions; + isUntrusted?: boolean; + isOverride?: boolean; + isClaimableBalance?: boolean; + notExist?: boolean; + source: any; + category?: AssetCategory; +} + +export interface SearchParamAsset { + assetString: string; + homeDomain?: string; +} + +export interface AssetSupportedActions { + sep6?: boolean; + sep8?: boolean; + sep24?: boolean; + sep31?: boolean; +} + +export interface AccountInitialState { + data: Types.AccountDetails | null; + assets: Asset[]; + errorString?: string; + isAuthenticated: boolean; + isUnfunded: boolean; + secretKey: string; + status: ActionStatus | undefined; +} + +export interface ActiveAssetInitialState { + action: ActiveAssetAction | undefined; + status: ActionStatus | undefined; +} + +export interface AllAssetsInitialState { + data: Asset[]; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface AssetOverridesInitialState { + data: Asset[]; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface ClaimAssetInitialState { + data: { + result: any; + trustedAssetAdded?: string; + }; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface ClaimableBalancesInitialState { + data: { + records: ClaimableAsset[] | null; + }; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface Sep24DepositAssetInitialState { + data: { + currentStatus: string; + trustedAssetAdded?: string; + }; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface LogsInitialState { + items: LogItemProps[]; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface SendPaymentInitialState { + data: Horizon.TransactionResponse | null; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface SettingsInitialState { + assetOverrides: string; + pubnet: boolean; + secretKey: string; + untrustedAssets: string; + claimableBalanceSupported: boolean; +} + +export interface UntrustedAssetsInitialState { + data: Asset[]; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface AnyObject { + [key: string]: any; +} + +export interface AssetsObject { + [key: string]: Asset; +} + +export interface StringObject { + [key: string]: string; +} + +export interface NestedStringObject { + [key: string]: { + [key: string]: string; + }; +} + +export interface CustomerTypeItem { + type: string; + description: string; +} + +interface Sep6DepositResponse { + /* eslint-disable camelcase */ + how: string; + id?: string; + eta?: number; + min_amount?: number; + max_amount?: number; + fee_fixed?: number; + fee_percent?: number; + extra_info?: { message?: string }; + /* eslint-enable camelcase */ +} + +export interface Sep6DepositAssetInitialState { + data: { + assetCode: string; + assetIssuer: string; + currentStatus: string; + kycServer: string; + token: string; + transferServerUrl: string; + infoFields: { + [key: string]: AnyObject; + }; + minAmount: number; + maxAmount: number; + customerFields: { + [key: string]: AnyObject; + }; + depositResponse: Sep6DepositResponse; + trustedAssetAdded: string; + }; + errorString?: string; + status: ActionStatus; +} + +interface Sep6WithdrawResponse { + /* eslint-disable camelcase */ + account_id: string; + id?: string; + eta?: number; + memo_type?: string; + memo?: string; + min_amount?: number; + max_amount?: number; + fee_fixed?: number; + fee_percent?: number; + extra_info?: { message?: string }; + /* eslint-enable camelcase */ +} + +export interface Sep6WithdrawAssetInitialState { + data: { + assetCode: string; + assetIssuer: string; + currentStatus: string; + fields: { + [key: string]: AnyObject; + }; + kycServer: string; + token: string; + transferServerUrl: string; + trustedAssetAdded: string; + withdrawTypes: { + types: { + [key: string]: { + fields: { + [key: string]: { + description: string; + }; + }; + }; + }; + }; + transactionResponse: AnyObject; + withdrawResponse: Sep6WithdrawResponse; + }; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface Sep31SendInitialState { + data: { + publicKey: string; + homeDomain: string; + assetCode: string; + assetIssuer: string; + token: string; + fields: { + transaction: AnyObject; + sender: AnyObject; + receiver: AnyObject; + }; + isTypeSelected: boolean; + senderType: string | undefined; + receiverType: string | undefined; + senderMemo: string; + receiverMemo: string; + multipleSenderTypes: CustomerTypeItem[] | undefined; + multipleReceiverTypes: CustomerTypeItem[] | undefined; + authEndpoint: string; + sendServer: string; + kycServer: string; + serverSigningKey: string; + }; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface Setting { + [key: string]: any; +} + +export interface TrustAssetInitialState { + assetString: string; + data: any; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface Sep24WithdrawAssetInitialState { + data: { + currentStatus: string; + }; + errorString?: string; + status: ActionStatus | undefined; +} + +export interface TrustAssetParam { + assetString: string; + assetCode: string; + assetIssuer: string; +} + +export enum LogType { + REQUEST = "request", + RESPONSE = "response", + INSTRUCTION = "instruction", + ERROR = "error", +} + +export interface LogItemProps { + timestamp: number; + type: LogType; + title: string; + body?: string | AnyObject; +} + +export interface Store { + account: AccountInitialState; + activeAsset: ActiveAssetInitialState; + allAssets: AllAssetsInitialState; + assetOverrides: AssetOverridesInitialState; + claimAsset: ClaimAssetInitialState; + claimableBalances: ClaimableBalancesInitialState; + logs: LogsInitialState; + sendPayment: SendPaymentInitialState; + sep6DepositAsset: Sep6DepositAssetInitialState; + sep6WithdrawAsset: Sep6WithdrawAssetInitialState; + sep8Send: Sep8SendInitialState; + sep31Send: Sep31SendInitialState; + sep24DepositAsset: Sep24DepositAssetInitialState; + sep24WithdrawAsset: Sep24WithdrawAssetInitialState; + settings: SettingsInitialState; + trustAsset: TrustAssetInitialState; + untrustedAssets: UntrustedAssetsInitialState; +} + +export type StoreKey = keyof Store; + +export enum NetworkType { + PUBLIC = "public", + TESTNET = "testnet", +} + +export enum ActionStatus { + ERROR = "ERROR", + PENDING = "PENDING", + SUCCESS = "SUCCESS", + NEEDS_INPUT = "NEEDS_INPUT", + CAN_PROCEED = "CAN_PROCEED", +} + +export interface RejectMessage { + errorString: string; +} + +export interface PaymentTransactionParams { + amount: string; + assetCode?: string; + assetIssuer?: string; + destination: string; + isDestinationFunded: boolean; + publicKey: string; +} + +export interface ClaimableAsset extends Asset { + id: string; + sponsor: string; + lastModifiedLedger: number; + claimants: any[]; +} + +export interface ActiveAssetAction { + assetString: string; + title: string; + description?: string | React.ReactNode; + callback: (args?: any) => void; + options?: ReactNode; +} + +export interface AssetActionItem extends ActiveAssetAction { + balance: Asset; +} + +export enum AssetActionId { + SEND_PAYMENT = "send-payment", + SEP6_DEPOSIT = "sep6-deposit", + SEP6_WITHDRAW = "sep6-withdraw", + SEP8_SEND_PAYMENT = "sep8-send-payment", + SEP24_DEPOSIT = "sep24-deposit", + SEP24_WITHDRAW = "sep24-withdraw", + SEP31_SEND = "sep31-send", + TRUST_ASSET = "trust-asset", + REMOVE_ASSET = "remove-asset", + ADD_ASSET_OVERRIDE = "add-asset-override", + REMOVE_ASSET_OVERRIDE = "remove-asset-override", +} + +export enum AssetType { + NATIVE = "native", +} + +export enum TransactionStatus { + COMPLETED = "completed", + ERROR = "error", + INCOMPLETE = "incomplete", + PENDING_ANCHOR = "pending_anchor", + PENDING_CUSTOMER_INFO_UPDATE = "pending_customer_info_update", + PENDING_EXTERNAL = "pending_external", + PENDING_RECEIVER = "pending_receiver", + PENDING_SENDER = "pending_sender", + PENDING_STELLAR = "pending_stellar", + PENDING_TRANSACTION_INFO_UPDATE = "pending_transaction_info_update", + PENDING_TRUST = "pending_trust", + PENDING_USER = "pending_user", + PENDING_USER_TRANSFER_START = "pending_user_transfer_start", +} + +export enum MemoTypeString { + TEXT = "text", + ID = "id", + HASH = "hash", +} + +export enum AnchorActionType { + DEPOSIT = "deposit", + WITHDRAWAL = "withdraw", +} + +interface InfoTypeData { + // eslint-disable-next-line camelcase + authentication_required: boolean; + enabled: boolean; + fields: AnyObject; + types: AnyObject; + // eslint-disable-next-line camelcase + min_amount?: number; + // eslint-disable-next-line camelcase + max_amount?: number; +} + +export interface CheckInfoData { + [AnchorActionType.DEPOSIT]: { + [asset: string]: InfoTypeData; + }; + [AnchorActionType.WITHDRAWAL]: { + [asset: string]: InfoTypeData; + }; +} + +export enum Sep8ApprovalStatus { + ACTION_REQUIRED = "action_required", + PENDING = "pending", + REJECTED = "rejected", + REVISED = "revised", + SUCCESS = "success", +} + +export enum Sep8Step { + DISABLED = "disabled", + STARTING = "starting", + PENDING = "pending", + TRANSACTION_REVISED = "transaction_revised", + ACTION_REQUIRED = "action_required", + SENT_ACTION_REQUIRED_FIELDS = "sent_action_required_fields", + COMPLETE = "complete", +} + +export interface Sep8PaymentTransactionParams extends PaymentTransactionParams { + approvalServer: string; + assetCode: string; + assetIssuer: string; +} + +export interface Sep8SendInitialState { + data: { + sep8Step: Sep8Step; + approvalCriteria: string; + approvalServer: string; + assetCode: string; + assetIssuer: string; + homeDomain: string; + isRegulated: boolean; + revisedTransaction: { + amount: string; + destination: string; + revisedTxXdr: string; + submittedTxXdr: string; + }; + actionRequiredInfo: { + actionFields?: Sep9Field[]; + actionMethod: string; + actionUrl: string; + message: string; + }; + actionRequiredResult: { + result: string; + nextUrl?: string; + message?: string; + }; + }; + errorString?: string; + status?: ActionStatus; +} + +export interface Sep8RevisedTransactionInfo { + amount: string; + destination: string; + revisedTxXdr: string; + submittedTxXdr: string; +} + +export interface Sep8ApprovalResponse { + status: Sep8ApprovalStatus; + revisedTransaction?: Sep8RevisedTransactionInfo; + actionRequiredInfo?: Sep8ActionRequiredInfo; +} + +export interface Sep8ActionRequiredInfo { + actionFields?: Sep9Field[]; + actionMethod: string; + actionUrl: string; + message: string; +} + +export interface Sep8ActionRequiredSendParams { + actionFields: { [key: string]: string | File }; + actionMethod: string; + actionUrl: string; +} + +export enum Sep8ActionRequiredResultType { + FOLLOW_NEXT_URL = "follow_next_url", + NO_FURTHER_ACTION_REQUIRED = "no_further_action_required", +} + +export interface Sep8ActionRequiredSentResult { + result: string; + nextUrl?: string; + message?: string; +} + +export enum Sep12CustomerStatus { + ACCEPTED = "ACCEPTED", + PROCESSING = "PROCESSING", + NEEDS_INFO = "NEEDS_INFO", + REJECTED = "REJECTED", +} + +export enum Sep12CustomerFieldStatus { + ACCEPTED = "ACCEPTED", + PROCESSING = "PROCESSING", + NOT_PROVIDED = "NOT_PROVIDED", + REJECTED = "REJECTED", + VERIFICATION_REQUIRED = "VERIFICATION_REQUIRED", +} diff --git a/src/methods/sep10Auth/sign.ts b/src/methods/sep10Auth/sign.ts deleted file mode 100644 index 2b9084e8..00000000 --- a/src/methods/sep10Auth/sign.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Keypair, Transaction } from "stellar-sdk"; -import { log } from "helpers/log"; - -export const sign = ({ - challengeTransaction, - networkPassphrase, - secretKey, -}: { - challengeTransaction: Transaction; - networkPassphrase: string; - secretKey: string; -}) => { - log.instruction({ - title: - "We’ve received a challenge transaction from the server that we need the sending anchor to sign with their Stellar private key", - }); - - const envelope = challengeTransaction.toEnvelope().toXDR("base64"); - const transaction = new Transaction(envelope, networkPassphrase); - transaction.sign(Keypair.fromSecret(secretKey)); - - log.instruction({ title: "SEP-10 signed transaction", body: transaction }); - log.instruction({ - title: "SEP-10 signed transaction, `base64` encoded", - body: transaction.toEnvelope().toXDR("base64"), - }); - - return transaction; -}; diff --git a/tempLogFile.md b/tempLogFile.md deleted file mode 100644 index b9ef3cf0..00000000 --- a/tempLogFile.md +++ /dev/null @@ -1,34 +0,0 @@ - - -# Changes - -- New UI account info -- New UI add asset -- New UI logs -- New UI claimable balance + more logs -- New UI send payment -- New UI deposit -- New UI withdrawal -- Text update on landing + remove issuer from add asset -- New UI balances and assets -- Claimable balance with confirmation modal -- SEP-31 Send UX updates -- Fix bug when active asset not set after SEP-24 popup closed -- Download logs markdown file -- Improve error messages -- Code review fixes 1 -- Sign out confirmation -- Assets update + home domain override -- Update text + add tooltip to some components -- SEP tweaks (home domain, TOML, check info) -- Sign out prompt to save URL + code styling -- Configuration modal + claimableBalanceSupported search param -- Improve UX with loaders + some fixes -- Reset asset action dropdown after modal is dismissed -- Add Amplitude and Sentry integrations -- Add announcement banner -- SEP-6 and SEP-8 -- SEP-31 send fix -- SEP-12 customer fields -- SEP-6 updates -- Dark mode diff --git a/tsconfig.json b/tsconfig.json index 3d27cc15..2f4d73a0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,12 @@ { "extends": "@stellar/tsconfig", "compilerOptions": { - "baseUrl": "src/", - "target": "es5", + "importHelpers": true, + "target": "ES2019", "lib": ["dom", "dom.iterable", "esnext"], "module": "esnext", "moduleResolution": "node", - "noEmit": true, - "jsx": "react-jsx", + "jsx": "react", "allowSyntheticDefaultImports": true - }, - "include": ["src"] -} + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 935cef24..83b7a7e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1938,6 +1938,18 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@cspotcode/source-map-consumer@0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" + integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg== + +"@cspotcode/source-map-support@0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5" + integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA== + dependencies: + "@cspotcode/source-map-consumer" "0.8.0" + "@csstools/convert-colors@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" @@ -2692,6 +2704,26 @@ dependencies: "@babel/runtime" "^7.12.5" +"@tsconfig/node10@^1.0.7": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" + integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + +"@tsconfig/node12@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" + integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + +"@tsconfig/node14@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + +"@tsconfig/node16@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" + integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== + "@types/anymatch@*": version "1.3.1" resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" @@ -2735,11 +2767,26 @@ dependencies: "@babel/types" "^7.3.0" +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + "@types/chai@4": version "4.2.22" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.22.tgz#47020d7e4cf19194d43b5202f35f75bd2ad35ce7" integrity sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ== +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + "@types/cookiejar@*": version "2.1.2" resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8" @@ -2764,9 +2811,47 @@ integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== "@types/eventsource@^1.1.2": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.5.tgz#408e9b45efb176c8bea672ab58c81e7ab00d24bc" - integrity sha512-BA9q9uC2PAMkUS7DunHTxWZZaVpeNzDG8lkBxcKwzKJClfDQ4Z59/Csx7HSH/SIqFN2JWh0tAKAM6k/wRR0OZg== + version "1.1.7" + resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.7.tgz#685e864e7a2b1fb07d54c566a1a5c50d0a91ddc6" + integrity sha512-ac36T7U0sz2+vrYT3oTU4x0dnNOZcI2rmUFfSA8pIpXKYPNGHMZs8KzJ+WuF6aPRQu8RAvGgnoLUWMXhC7Widw== + +"@types/express-serve-static-core@^4.17.18": + version "4.17.25" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz#e42f7046adc65ece2eb6059b77aecfbe9e9f82e0" + integrity sha512-OUJIVfRMFijZukGGwTpKNFprqCCXk5WjNGvUgB/CxxBR40QWSjsNK86+yvGKlCOGc7sbwfHLaXhkG+NsytwBaQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@^4.17.13": + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" + integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/express-serve-static-core@^4.17.18": + version "4.17.25" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz#e42f7046adc65ece2eb6059b77aecfbe9e9f82e0" + integrity sha512-OUJIVfRMFijZukGGwTpKNFprqCCXk5WjNGvUgB/CxxBR40QWSjsNK86+yvGKlCOGc7sbwfHLaXhkG+NsytwBaQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@^4.17.13": + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" + integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" "@types/glob@^7.1.1": version "7.1.3" @@ -2876,6 +2961,11 @@ resolved "https://registry.yarnpkg.com/@types/marked/-/marked-3.0.1.tgz#748645ecde30d8cf7861c3e1c360c6f694172f92" integrity sha512-jry/WUAC511P2NBCeiCkfTRCN2VXobeeQa8p8gImOYsRfnuIVfeEsqOJ1pk+CzCwfMCdv3dkTQRCYaNkkFGtxw== +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + "@types/minimatch@*", "@types/minimatch@^3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -2887,15 +2977,20 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/node@*", "@types/node@>= 8": - version "14.14.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.25.tgz#15967a7b577ff81383f9b888aa6705d43fbbae93" - integrity sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ== + version "16.11.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.10.tgz#2e3ad0a680d96367103d3e670d41c2fed3da61ae" + integrity sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA== "@types/node@^16.10.3": version "16.10.3" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== +"@types/node@^16.11.8": + version "16.11.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.8.tgz#a1aeb23f0aa33cb111e64ccaa1687b2ae0423b69" + integrity sha512-hmT5gfpRkkHr7DZZHMf3jBe/zNcVGN+jXSL2f8nAsYfBPxQFToKwQlS/zES4Sjp488Bi73i+p6bvrNRRGU0x9Q== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -2921,6 +3016,11 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + "@types/randombytes@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" @@ -2928,6 +3028,11 @@ dependencies: "@types/node" "*" +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + "@types/react-copy-to-clipboard@^5.0.1": version "5.0.1" resolved "https://registry.yarnpkg.com/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.1.tgz#7d9c2c0af52e2e8106ebe2b9fde4f02859af7a3d" @@ -3015,6 +3120,14 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== +"@types/serve-static@*": + version "1.13.10" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" + integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + "@types/source-list-map@*": version "0.1.2" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" @@ -3034,14 +3147,6 @@ "@types/react" "*" csstype "^3.0.2" -"@types/superagent@^3.8.3": - version "3.8.7" - resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-3.8.7.tgz#1f1ed44634d5459b3a672eb7235a8e7cfd97704c" - integrity sha512-9KhCkyXv268A2nZ1Wvu7rQWM+BmdYUVkycFeNnYrUL5Zwu7o8wPQ3wBfW59dDP+wuoxw0ww8YKgTNv8j/cgscA== - dependencies: - "@types/cookiejar" "*" - "@types/node" "*" - "@types/tapable@*", "@types/tapable@^1.0.5": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.6.tgz#a9ca4b70a18b270ccb2bc0aaafefd1d486b7ea74" @@ -3062,9 +3167,9 @@ source-map "^0.6.1" "@types/urijs@^1.19.6": - version "1.19.14" - resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.14.tgz#1c714cfbc23eb9e3f840dd02b7e8284ab85f1a6b" - integrity sha512-Ds9OMd4xZqI2zZtoOicASAi0SvFPyNPgkfgPrPeUTQwcJOX1w6Mwkpq8ClI4ZP11nsEI6akvKqRDV+epA8yzRw== + version "1.19.17" + resolved "https://registry.yarnpkg.com/@types/urijs/-/urijs-1.19.17.tgz#232ac9884b6a2aeab5dbe70b79cdb91d5067c325" + integrity sha512-ShIlp+8iNGo/yVVfYFoNRqUiaE9wMCzsSl85qTg2/C5l56BTJokU7QeMgVBQ9xhcyhWQP0zGXPBZPPvEG/sRmQ== "@types/webpack-sources@*": version "2.1.0" @@ -3482,6 +3587,11 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -3492,6 +3602,11 @@ acorn@^7.1.0, acorn@^7.1.1, acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.4.1: + version "8.6.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" + integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== + address@1.1.2, address@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" @@ -3658,6 +3773,11 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -3896,12 +4016,12 @@ axe-core@^4.0.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.1.tgz#70a7855888e287f7add66002211a423937063eaf" integrity sha512-5Kgy8Cz6LPC9DJcNb3yjAXTu3XihQgEdnIg50c//zOC/MyLP0Clg+Y8Sh9ZjjnvBrDZU4DgXS9C3T9r4/scGZQ== -axios@0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== +axios@0.21.4: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: - follow-redirects "^1.10.0" + follow-redirects "^1.14.0" axobject-query@^2.2.0: version "2.2.0" @@ -4607,19 +4727,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chai-http@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/chai-http/-/chai-http-4.3.0.tgz#3c37c675c1f4fe685185a307e345de7599337c1a" - integrity sha512-zFTxlN7HLMv+7+SPXZdkd5wUlK+KxH6Q7bIEMiEx0FK3zuuMqL7cwICAQ0V1+yYRozBburYuxN1qZstgHpFZQg== - dependencies: - "@types/chai" "4" - "@types/superagent" "^3.8.3" - cookiejar "^2.1.1" - is-ip "^2.0.0" - methods "^1.1.2" - qs "^6.5.1" - superagent "^3.7.0" - chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -4927,7 +5034,7 @@ commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^4.1.1: +commander@^4.0.0, commander@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== @@ -4957,7 +5064,7 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= -component-emitter@^1.2.0, component-emitter@^1.2.1: +component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== @@ -5095,11 +5202,6 @@ cookie@0.4.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== -cookiejar@^2.1.0, cookiejar@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" - integrity sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA== - copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" @@ -5241,6 +5343,11 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-fetch@^3.0.4: version "3.0.6" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" @@ -5257,7 +5364,7 @@ cross-spawn@7.0.3, cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -cross-spawn@^6.0.0: +cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== @@ -5534,11 +5641,6 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.6.tgz#865d0b5833d7d8d40f4e5b8a6d76aea3de4725ef" integrity sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw== -cursor@^0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/cursor/-/cursor-0.1.5.tgz#ea778c2b09d33c2e564fd92147076750483ebb2c" - integrity sha1-6neMKwnTPC5WT9khRwdnUEg+uyw= - cyclist@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" @@ -5585,7 +5687,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@^3.1.0, debug@^3.1.1, debug@^3.2.6, debug@^3.2.7: +debug@^3.1.1, debug@^3.2.6, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -5740,9 +5842,9 @@ detect-newline@^3.0.0: integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== detect-node@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" - integrity sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" + integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== detect-port-alt@1.1.6: version "1.1.6" @@ -5767,6 +5869,11 @@ diff-sequences@^27.0.6: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -6087,6 +6194,14 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +env-cmd@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/env-cmd/-/env-cmd-10.1.0.tgz#c7f5d3b550c9519f137fdac4dd8fb6866a8c8c4b" + integrity sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA== + dependencies: + commander "^4.0.0" + cross-spawn "^7.0.0" + env-paths@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" @@ -6683,9 +6798,9 @@ events@^3.0.0, events@^3.2.0: integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== eventsource@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" - integrity sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.0.tgz#00e8ca7c92109e94b0ddf32dac677d841028cfaf" + integrity sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg== dependencies: original "^1.0.0" @@ -6833,7 +6948,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.2: +extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -7020,6 +7135,13 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-config@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-config/-/find-config-1.0.0.tgz#eafa2b9bc07fa9c90e9a0c3ef9cecf1cc800f530" + integrity sha1-6vorm8B/qckOmgw++c7PHMgA9TA= + dependencies: + user-home "^2.0.0" + find-up@4.1.0, find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -7081,10 +7203,10 @@ follow-redirects@^1.0.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.2.tgz#dd73c8effc12728ba5cf4259d760ea5fb83e3147" integrity sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA== -follow-redirects@^1.10.0: - version "1.13.3" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.3.tgz#e5598ad50174c1bc4e872301e82ac2cd97f90267" - integrity sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA== +follow-redirects@^1.14.0: + version "1.14.5" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381" + integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA== for-in@^1.0.2: version "1.0.2" @@ -7109,15 +7231,6 @@ fork-ts-checker-webpack-plugin@4.1.6: tapable "^1.0.0" worker-rpc "^0.1.0" -form-data@^2.3.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" - integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -7127,11 +7240,6 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -formidable@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9" - integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q== - forwarded@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" @@ -8055,7 +8163,7 @@ internal-slot@^1.0.2, internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" -ip-regex@^2.0.0, ip-regex@^2.1.0: +ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= @@ -8292,13 +8400,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-ip@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-2.0.0.tgz#68eea07e8a0a0a94c2d080dd674c731ab2a461ab" - integrity sha1-aO6gfooKCpTC0IDdZ0xzGrKkYas= - dependencies: - ip-regex "^2.0.0" - is-lower-case@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-1.1.3.tgz#7e147be4768dc466db3bfb21cc60b31e6ad69393" @@ -9056,11 +9157,10 @@ js-base64@^2.1.8: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-xdr@^1.1.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-1.2.0.tgz#aa428a69eb3ddb7ad1ecba92838808bc2f579a97" - integrity sha512-ziYlgwMofC0QK2K9M4Pwl3NNyfB5ObZxd86+vl2cWOxAVRhtB1xDnBV9nCxnA105c+lf3lfM0tvNtdm+FRpZOA== + version "1.3.0" + resolved "https://registry.yarnpkg.com/js-xdr/-/js-xdr-1.3.0.tgz#e72e77c00bbdae62689062b95fe35ae2bd90df32" + integrity sha512-fjLTm2uBtFvWsE3l2J14VjTuuB8vJfeTtYuNS7LiLHDWIX2kt0l1pqq9334F8kODUkKPMuULjEcbGbkFFwhx5g== dependencies: - cursor "^0.1.5" lodash "^4.17.5" long "^2.2.3" @@ -9490,12 +9590,12 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.5, lodash@~4.17.10: +"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@~4.17.10: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== -lodash@^4.17.21, lodash@^4.17.3: +lodash@^4.17.21, lodash@^4.17.3, lodash@^4.17.5: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9587,6 +9687,11 @@ make-dir@^3.0.0, make-dir@^3.0.2: dependencies: semver "^6.0.0" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -9661,6 +9766,11 @@ memory-fs@^0.5.0: errno "^0.1.3" readable-stream "^2.0.1" +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + meow@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/meow/-/meow-9.0.0.tgz#cd9510bc5cac9dee7d03c73ee1f9ad959f4ea364" @@ -9694,7 +9804,7 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -methods@^1.1.1, methods@^1.1.2, methods@~1.1.2: +methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= @@ -9759,7 +9869,7 @@ mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, dependencies: mime-db "1.45.0" -mime@1.6.0, mime@^1.4.1: +mime@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== @@ -9961,11 +10071,16 @@ multimatch@^4.0.0: arrify "^2.0.1" minimatch "^3.0.4" -nan@^2.12.1, nan@^2.13.2, nan@^2.14.0: +nan@^2.12.1, nan@^2.13.2: version "2.14.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== +nan@^2.14.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + nanoid@^3.1.20: version "3.1.20" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" @@ -10046,9 +10161,9 @@ node-forge@^0.10.0: integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== node-gyp-build@^4.1.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" - integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== node-gyp@^7.1.0: version "7.1.2" @@ -10207,6 +10322,21 @@ normalize-url@^3.0.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== +npm-run-all@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba" + integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ== + dependencies: + ansi-styles "^3.2.1" + chalk "^2.4.1" + cross-spawn "^6.0.5" + memorystream "^0.3.1" + minimatch "^3.0.4" + pidtree "^0.3.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -10489,6 +10619,11 @@ os-browserify@^0.3.0: resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + p-each-series@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" @@ -10782,6 +10917,11 @@ picomatch@^2.2.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== +pidtree@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" + integrity sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA== + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -11771,13 +11911,6 @@ qs@6.7.0: resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== -qs@^6.5.1: - version "6.10.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -12143,7 +12276,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -12936,6 +13069,11 @@ shell-quote@1.7.2: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== +shell-quote@^1.6.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123" + integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw== + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -13270,10 +13408,10 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= -stellar-base@^6.0.1: - version "6.0.3" - resolved "https://registry.yarnpkg.com/stellar-base/-/stellar-base-6.0.3.tgz#14ac70ee74a974142fb2509b01649f9b3bb5cf3f" - integrity sha512-3xQo7VU2u84CQZ4ZxOk+TVXAUuMkwNbWzMcUSEcYja5i5CRX1RK1ivP9pn/VENIsLgu5tWhQeBMt3WHOo1ryBw== +stellar-base@^6.0.6: + version "6.0.6" + resolved "https://registry.yarnpkg.com/stellar-base/-/stellar-base-6.0.6.tgz#2f95ad35ab6901a2fc0d5cb5b483436241b7123c" + integrity sha512-v0t9jeP456plMpye8W2vRq2lTvMUvRkskH5GGfqgMTeX+gBAwp7Y67wYphRt2pGQ2NXtxlsgEBSBKWvNxGp76A== dependencies: base32.js "^0.1.0" bignumber.js "^4.0.0" @@ -13292,24 +13430,23 @@ stellar-identicon-js@^1.0.0: dependencies: html-webpack-plugin "^3.2.0" -stellar-sdk@^9.0.0-beta.1: - version "9.0.0" - resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-9.0.0.tgz#c976030a077f11d8834cfec3e50ef313663c3388" - integrity sha512-eIX5orvWBmg4f5yzz2QL2XYlzxguxn2VZPVbc99yIeLxKnwvIm7Ia0TIsCurk6H2xucjX054MtMUWq953qENug== +stellar-sdk@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/stellar-sdk/-/stellar-sdk-9.1.0.tgz#6950a1ca8c268218b9be179c120c23f284ea6f5a" + integrity sha512-Y2B/pGM+eEC4Iuf6vGBGD86AdXYHCahuEiTa7kMOSDR/SXv7UQdOcrEpho+ZjTqZP0cYBe9UOTkYiW12Sm3IzQ== dependencies: "@types/eventsource" "^1.1.2" "@types/node" ">= 8" "@types/randombytes" "^2.0.0" "@types/urijs" "^1.19.6" - axios "0.21.1" + axios "0.21.4" bignumber.js "^4.0.0" - chai-http "^4.3.0" detect-node "^2.0.4" es6-promise "^4.2.4" eventsource "^1.0.7" lodash "^4.17.21" randombytes "^2.1.0" - stellar-base "^6.0.1" + stellar-base "^6.0.6" toml "^2.3.0" tslib "^1.10.0" urijs "^1.19.1" @@ -13437,6 +13574,15 @@ string.prototype.matchall@^4.0.5: regexp.prototype.flags "^1.3.1" side-channel "^1.0.4" +string.prototype.padend@^3.0.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz#997a6de12c92c7cb34dc8a201a6c53d9bd88a5f1" + integrity sha512-jNIIeokznm8SD/TZISQsZKYu7RJyheFNt84DUPrh482GC8RVp2MKqm2O5oBRdGxbDQoXrhhWtPIWQOiy20svUg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + string.prototype.trimend@^1.0.1, string.prototype.trimend@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz#a22bd53cca5c7cf44d7c9d5c732118873d6cd18b" @@ -13607,22 +13753,6 @@ stylehacks@^4.0.0: postcss "^7.0.0" postcss-selector-parser "^3.0.0" -superagent@^3.7.0: - version "3.8.3" - resolved "https://registry.yarnpkg.com/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128" - integrity sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA== - dependencies: - component-emitter "^1.2.0" - cookiejar "^2.1.0" - debug "^3.1.0" - extend "^3.0.0" - form-data "^2.3.1" - formidable "^1.2.0" - methods "^1.1.1" - mime "^1.4.1" - qs "^6.5.1" - readable-stream "^2.3.5" - supports-color@8.1.1, supports-color@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -14014,6 +14144,24 @@ ts-essentials@^2.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== +ts-node@^10.4.0: + version "10.4.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.4.0.tgz#680f88945885f4e6cf450e7f0d6223dd404895f7" + integrity sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A== + dependencies: + "@cspotcode/source-map-support" "0.7.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + yn "3.1.1" + ts-pnp@1.2.0, ts-pnp@^1.1.6: version "1.2.0" resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" @@ -14179,6 +14327,11 @@ typescript@^4.4.3, typescript@~4.4.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== +typescript@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== + u2f-api@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/u2f-api/-/u2f-api-0.2.7.tgz#17bf196b242f6bf72353d9858e6a7566cc192720" @@ -14343,9 +14496,9 @@ url-loader@4.1.1: schema-utils "^3.0.0" url-parse@^1.4.3: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== + version "1.5.3" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862" + integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ== dependencies: querystringify "^2.1.1" requires-port "^1.0.0" @@ -14390,6 +14543,13 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + integrity sha1-nHC/2Babwdy/SGBODwS4tJzenp8= + dependencies: + os-homedir "^1.0.0" + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -15079,6 +15239,11 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"