Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.2.0 #177

Merged
merged 27 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0997f7c
Revert "Disable support to SEP-8 payments (#166)" (#167)
marcelosalloum May 24, 2021
619dbcc
Support SEP-8 "Action Required" flow (#164)
marcelosalloum May 24, 2021
4cfc56b
Feature/sep 6 deposit (#163)
piyalbasu May 24, 2021
73ed75c
SEP-6 Withdrawal Flow (#168)
piyalbasu May 24, 2021
b1f66cf
GitHub link in footer (#162)
quietbits May 24, 2021
d1824ea
Add instructions to Test SEP-8 Payments (#170)
marcelosalloum May 25, 2021
6749913
GitHub learn more and issue links (#171)
quietbits May 25, 2021
ccfaf20
Support sending payments to muxed accounts (#173)
piyalbasu May 25, 2021
b95ca52
Poll withdraw/deposit flows and update UI on completion (#172)
piyalbasu May 25, 2021
5eeeefa
Fix SEP-8 action_required return condition (#174)
marcelosalloum May 26, 2021
59d2de0
Support all SEP-9 fields when handling SEP-8 "action_required" respon…
marcelosalloum May 27, 2021
c021051
Support SEP-8 "action_required" responses with GET action methods (#176)
marcelosalloum May 27, 2021
7f6ef43
SEP-31: add description explaining the premise of demo-ing SEP-31 (#179)
marcelosalloum Jun 4, 2021
e587eaa
Sentry: do not trace any origin (localhost CORS issue) (#182) (#184)
quietbits Jun 8, 2021
b89a977
Update Sentry tracingOrigins (#186)
quietbits Jun 9, 2021
574bfe8
Fix log when receiving an empty (or "0") timestamp from a SEP-8 "pend…
marcelosalloum Jun 9, 2021
784ddd8
Keep asset balance when overriding home domain (#190)
quietbits Jun 22, 2021
f6fca5c
Trigger PR preview
quietbits Jun 23, 2021
b000d84
SEP-31 send: fix customer type (#191)
quietbits Jun 24, 2021
442c5d4
SEP-12: Check customer fields status (#193)
quietbits Jun 24, 2021
5fc22a6
Trigger PR preview update
quietbits Jun 24, 2021
b0c9c5e
Do not show actions for untrusted regulated assets (#194)
quietbits Jun 25, 2021
fcda2b0
SEP-6 deposit updates (#189)
quietbits Jun 25, 2021
705e45b
Trigger PR preview update
quietbits Jun 25, 2021
40eb445
SEP-8: update UX for the Action Required flow (#198)
marcelosalloum Jul 1, 2021
a4fccfb
Update README.md (#197)
Jul 7, 2021
504e175
Add Release Notes (#200)
Jul 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 108 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Stellar Demo Wallet

This Stellar Demo Wallet is our newly rebuilt application for
interactively testing anchor services. If you would like to automate testing of
your anchor service, check out the SDF's
This Stellar Demo Wallet is our newly rebuilt application for interactively
testing anchor services. If you would like to automate testing of your anchor
service, check out the SDF's
[anchor validation suite](https://github.com/stellar/transfer-server-validator)
viewable at [anchor-validator.stellar.org](anchor-validator.stellar.org).

Expand All @@ -16,24 +16,75 @@ feel free to clone or copy any pieces that may be helpful.

## Getting A Test Account Up and Running

You can use the demo wallet to test Hosted Deposit and Withdrawal (SEP-24) and Cross-Border Payments (SEP-31) with any home domain that has a Stellar Info File (also known as SEP-1, or a stellar.toml file). The instructions below are for demo-ing standard integrations supported by Stellar test server, testanchor.stellar.org. For both integrations, the logs to the right of the screen will show every network call.

### Demo-ing a Deposit on Testnet with Hosted Deposit and Withdrawal (SEP-24)
1. Click "Generate keypair", and then click "Create account" - this will create a balance of 10,000 XLM.
2. Click “Add asset” and add `SRT` (this stands for Stellar Reference Token, it’s our representation of XLM for the test server) with the anchor home domain `testanchor.stellar.org`.
You can use the demo wallet to test Regulated Assets ([SEP-8]), Hosted Deposit
and Withdrawal ([SEP-24]) and Cross-Border Payments ([SEP-31]) with any home
domain that has a Stellar Info File (also known as [SEP-1], or a stellar.toml
file). The instructions below are for demo-ing standard integrations supported
by Stellar test server, testanchor.stellar.org or by the [SEP-8] reference
server, sep8-server.dev.stellar.org. For these integrations, the logs to the
right of the screen will show every network call.

### Demo-ing a Regulated Asset Payment ([SEP-8])

1. Click "Generate keypair", and then click "Create account" - this will create
a balance of 10,000 XLM.
2. Click “Add asset” and add `MYASSET` with the anchor home domain
`sep8-server.dev.stellar.org`.
3. Click “Add trustline” - this will allow you to hold MYASSET.
4. Click on the "Copy" link on the right of your public key and use that value
to get some unities of MYASSET using the link
`https://sep8-server.dev.stellar.org/friendbot?addr=<paste_your_address_here>`.
Refresh the [demo-wallet page](https://demo-wallet.stellar.org/) to see funds
in your account.
5. Select "SEP-8 Send" from the dropdown of MYASSET and click "Start" in the
modal.
6. In the "destination" field, input an address that also has a trustline to
MYASSET.
7. The modal will display the approval criteria used by the SEP-8 server.
Depending on the conditions described there your payment can be automatically
approved or you may be required to undergo an additional KYC step.
8. After your payment gets revised and signed by the SEP-8 reference server
you'll need to review the updated transaction before the demo wallet submits
the payment.
9. If the payment has been successfully sent you'll see "SEP-8 send payment
completed 🎉" in the logs.

### Demo-ing a Deposit on Testnet with Hosted Deposit and Withdrawal ([SEP-24])

1. Click "Generate keypair", and then click "Create account" - this will create
a balance of 10,000 XLM.
2. Click “Add asset” and add `SRT` (this stands for Stellar Reference Token,
it’s our representation of XLM for the test server) with the anchor home
domain `testanchor.stellar.org`.
3. Click “Add trustline” - this will allow you to hold SRT.
4. Select “SEP-24 deposit” from the dropdown for your SRT asset and click "Start" in the modal.
5. If your browser doesn't already, make sure it allows pop-ups - this is how the demo wallet requests KYC info.
6. Enter your name and email in the pop-up - this information doesn't need to be real, but the interface will want a valid email.
7. Click “Skip confirmation” - skipping it won't be possible in live integrations but helps the process move ahead in the demo.
8. Enter a number into the amount and click "Submit".
9. Leave the pop-up window open while you wait to see the deposit of SRT go through - you can close when you see “Status” is complete and you have SRT.

### Demo-ing Cross-Border Payments (SEP-31) on Testnet
4. Select “SEP-24 deposit” from the dropdown for your SRT asset and click
"Start" in the modal.
5. If your browser doesn't already, make sure it allows pop-ups - this is how
the demo wallet requests KYC info.
6. Enter your name and email in the pop-up - this information doesn't need to be
real, but the interface will want a valid email.
7. Click “Skip confirmation” - skipping it won't be possible in live
integrations but helps the process move ahead in the demo.
8. Enter a number into the amount and click "Submit".
9. Leave the pop-up window open while you wait to see the deposit of SRT go
through - you can close when you see “Status” is complete and you have SRT.

### Demo-ing Cross-Border Payments ([SEP-31]) on Testnet

_Note: specifically in the case of demo-ing SEP-31 in the Demo Wallet, notice
the public and secret keys don't represent the Sending Client but instead the
Sending Anchor's account. In SEP-31, the only Stellar transaction happening is
between the Sending and the Receiving anchors._

1. Follow the steps above in order to establish an amount of SRT to send.
2. Select “SEP-31 Send” from the dropdown for your SRT asset and click "Start" in the modal.
3. Enter the requested information in the pop-up - none of the info has to be real for this testanchor.stellar.org demo, this is only to show the fields required. When testing another anchor you may need to adhere to their validation requirements.
4. If the payment has been successfully sent you'll see "SEP-31 send payment completed" in the logs.
2. Select “SEP-31 Send” from the dropdown for your SRT asset and click "Start"
in the modal.
3. Enter the requested information in the pop-up - none of the info has to be
real for this testanchor.stellar.org demo, this is only to show the fields
required. When testing another anchor you may need to adhere to their
validation requirements.
4. If the payment has been successfully sent you'll see "SEP-31 send payment
completed" in the logs.

## Getting Started Building A Wallet From This Demo

Expand All @@ -57,19 +108,56 @@ yarn build

---

## Release Notes

### v1.2

- SEP-06 now supported
- SEP-08 now supported
- Fixed a [bug](https://github.com/stellar/stellar-demo-wallet/issues/188) when
overriding home domain
- Fixed an [issue](https://github.com/stellar/stellar-demo-wallet/issues/196)
where balance amounts were being overwritten
- Sending to Muxed Accounts is now supported

### [v1.1](https://github.com/stellar/stellar-demo-wallet/releases/tag/v1.1.0)

- Fix for local CORS issue
- Updated Sentry to log exceptions

### v1.0

- Revamped UI
- All SEPs are integrated into one tool
- SEP-24 and SEP-31 are now found in the Asset action drop-down menus
- Ablity to download logs
- Claimable Balances supported

## Roadmap

- [x] Improve local development story
- [x] Add config-by-url support
- [x] Implement Claimable Balance support
- [x] Add Pubnet Support
- [x] Improve UX
- [ ] Forward sep24.stellar.org traffic to demo-wallet.stellar.org
- [x] Implement SEP-31 support
- [ ] Forward sep24.stellar.org traffic to demo-wallet.stellar.org
- [ ] Deprecate older clients to use this tool instead
(sep31-demo-client.netlify.app, sep24.stellar.org, sep6.stellar.org)
- [ ] Implement SEP-6 support
- [ ] Implement SEP-8 support

### 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-1]:
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md
[sep-8]:
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0008.md
[sep-24]:
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0024.md
[sep-31]:
https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0031.md
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"redux": "^4.0.5",
"stellar-sdk": "^8.0.0",
"stellar-sdk": "^8.2.1",
"styled-components": "^5.2.1",
"toml": "^3.0.0",
"typescript": "~4.1.3",
Expand Down
43 changes: 24 additions & 19 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PageContent } from "components/PageContent";
import { PrivateRoute } from "components/PrivateRoute";
import { SettingsHandler } from "components/SettingsHandler";
import { WarningBanner } from "components/WarningBanner";
import { TextLink, TextLinkVariant } from "@stellar/design-system";
import { TextLink } from "components/TextLink";

import { Account } from "pages/Account";
import { Landing } from "pages/Landing";
Expand All @@ -22,7 +22,12 @@ if (process.env.REACT_APP_SENTRY_KEY) {
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_KEY,
release: `demo-wallet@${process.env.npm_package_version}`,
integrations: [new Integrations.BrowserTracing()],
integrations: [
new Integrations.BrowserTracing({
// not attaching sentry-trace to any XHR/fetch outgoing requests
tracingOrigins: [/^\/[^/]/],
}),
],
tracesSampleRate: 1.0,
});
}
Expand All @@ -38,29 +43,29 @@ export const App = () => (
<div className="ContentWrapper">
<Header />

<div className="Announcement">
<div className="Inset">
<p>
Welcome to the new and improved Stellar demo wallet! Please
log bugs and feature requests at: &nbsp;
<TextLink
variant={TextLinkVariant.primary}
href="https://github.com/stellar/stellar-demo-wallet/issues"
rel="noreferrer"
target="_blank"
>
https://github.com/stellar/stellar-demo-wallet/issues
</TextLink>
</p>
</div>
</div>

<div className="IntroText Inset">
<p>
This demo wallet lets financial application developers test
their integrations and learn how Stellar ecosystem protocols
(SEPs) work.
</p>

<p>
<TextLink
href="https://github.com/stellar/stellar-demo-wallet#stellar-demo-wallet"
isExternal
>
Learn more
</TextLink>{" "}
about the tool and{" "}
<TextLink
href="https://github.com/stellar/stellar-demo-wallet/issues"
isExternal
>
report issues or request features
</TextLink>{" "}
on GitHub.
</p>
</div>

<PageContent>
Expand Down
56 changes: 54 additions & 2 deletions src/components/Assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export const Assets = ({
allAssets,
assetOverrides,
claimAsset,
sep6DepositAsset,
sep6WithdrawAsset,
sep24DepositAsset,
sep24WithdrawAsset,
sep31Send,
Expand All @@ -68,6 +70,8 @@ export const Assets = ({
"allAssets",
"assetOverrides",
"claimAsset",
"sep6DepositAsset",
"sep6WithdrawAsset",
"sep24DepositAsset",
"sep24WithdrawAsset",
"sep31Send",
Expand Down Expand Up @@ -228,7 +232,55 @@ export const Assets = ({
history,
]);

// Deposit asset
// SEP-6 Deposit asset
useEffect(() => {
if (
sep6DepositAsset.status === ActionStatus.SUCCESS &&
sep6DepositAsset.data.trustedAssetAdded
) {
handleRemoveUntrustedAsset(sep6DepositAsset.data.trustedAssetAdded);
}

if (sep6DepositAsset.data.currentStatus === TransactionStatus.COMPLETED) {
handleRefreshAccount();
handleFetchClaimableBalances();
}

setActiveAssetStatusAndToastMessage({
status: sep6DepositAsset.status,
message: "SEP-6 deposit in progress",
});
}, [
sep6DepositAsset.status,
sep6DepositAsset.data.currentStatus,
sep6DepositAsset.data.trustedAssetAdded,
handleRefreshAccount,
handleFetchClaimableBalances,
handleRemoveUntrustedAsset,
setActiveAssetStatusAndToastMessage,
]);

// SEP-6 Withdraw asset
useEffect(() => {
if (
sep6WithdrawAsset.status === ActionStatus.SUCCESS &&
sep6WithdrawAsset.data.currentStatus === TransactionStatus.COMPLETED
) {
handleRefreshAccount();
}

setActiveAssetStatusAndToastMessage({
status: sep6WithdrawAsset.status,
message: "SEP-6 withdrawal in progress",
});
}, [
sep6WithdrawAsset.status,
sep6WithdrawAsset.data.currentStatus,
handleRefreshAccount,
setActiveAssetStatusAndToastMessage,
]);

// SEP-24 Deposit asset
useEffect(() => {
if (sep24DepositAsset.status === ActionStatus.SUCCESS) {
dispatch(resetSep24DepositAssetAction());
Expand Down Expand Up @@ -261,7 +313,7 @@ export const Assets = ({
history,
]);

// Withdraw asset
// SEP-24 Withdraw asset
useEffect(() => {
if (sep24WithdrawAsset.status === ActionStatus.SUCCESS) {
dispatch(resetSep24WithdrawAssetAction());
Expand Down
37 changes: 35 additions & 2 deletions src/components/Balance.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useDispatch } from "react-redux";
import { TextLink } from "components/TextLink";
import { BalanceRow } from "components/BalanceRow";
import { initiateDepositAction as initiateSep6SendAction } from "ducks/sep6DepositAsset";
import { initiateWithdrawAction as initiateSep6WithdrawAction } from "ducks/sep6WithdrawAsset";
import { initiateSep8SendAction } from "ducks/sep8Send";
import { depositAssetAction } from "ducks/sep24DepositAsset";
import { initiateSendAction } from "ducks/sep31Send";
Expand Down Expand Up @@ -62,6 +64,14 @@ export const Balance = ({
return result;
};

const handleSep6Deposit = (asset: Asset) => {
dispatch(initiateSep6SendAction(asset));
};

const handleSep6Withdraw = (asset: Asset) => {
dispatch(initiateSep6WithdrawAction(asset));
};

const handleSep8Send = (asset: Asset) => {
dispatch(initiateSep8SendAction(asset));
};
Expand Down Expand Up @@ -114,6 +124,22 @@ export const Balance = ({
callback: onSend,
};
break;
case AssetActionId.SEP6_DEPOSIT:
props = {
...defaultProps,
title: `SEP-6 deposit ${balance.assetCode} (with Trusted Asset)`,
description: `Start SEP-6 deposit of trusted asset ${balance.assetCode}?`,
callback: () => handleSep6Deposit(balance),
};
break;
case AssetActionId.SEP6_WITHDRAW:
props = {
...defaultProps,
title: `SEP-6 withdrawal ${balance.assetCode}`,
description: `Start SEP-6 withdrawal of ${balance.assetCode}?`,
callback: () => handleSep6Withdraw(balance),
};
break;
case AssetActionId.SEP8_SEND_PAYMENT:
props = {
...defaultProps,
Expand Down Expand Up @@ -149,14 +175,21 @@ export const Balance = ({
callback: () => handleSep24Withdraw(balance),
};
break;
case AssetActionId.SEP31_SEND:
case AssetActionId.SEP31_SEND: {
let description = `Start SEP-31 send to ${balance.assetCode}?\n\n`;
description +=
"Please be aware that specifically in the case of demo-ing SEP-31 in the Demo Wallet the public and secret keys don't represent the Sending Client but instead the Sending Anchor's account.\n\n";
description +=
"In SEP-31, the only Stellar transaction happening is between the Sending and the Receiving anchors.";
props = {
...defaultProps,
title: `SEP-31 send ${balance.assetCode}`,
description: `Start SEP-31 send to ${balance.assetCode}?`,

description,
callback: () => handleSep31Send(balance),
};
break;
}
default:
// do nothing
}
Expand Down
Loading