Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Developer support issue
about: Meant for developers, if you have a user support request, please contact us at [email protected]
title: ""
labels: ""
assignees: ""
---

<!-- Please note that GitHub issues are meant for developer support! -->

<!-- If this is a **user support request**, please contact us on [email protected] -->
<!-- ⚠️ Be cautious of **scammers** pretending to be official support. Do not trust responses from anybody other than members of this repository. -->
32 changes: 32 additions & 0 deletions .github/on_issue_opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: On issue opened

on:
issues:
types: [opened]

jobs:
respond-to-issue:
runs-on: ubuntu-latest

steps:
- name: Post Automated Response
uses: actions/github-script@v6
with:
script: |
const issueNumber = context.payload.issue.number;

// Automated response message
const message = `
Please note that GitHub issues are meant for developer support.

- If this is a **user support request**, please contact us on [[email protected]]([email protected]).
- ⚠️ Be cautious of **scammers** pretending to be official support. Do not trust responses from anybody other than members of this repository.
`;

// Post the comment to the issue
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: message,
});
2 changes: 1 addition & 1 deletion app/frontend/components/common/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Footer = () => {
View on Github
</a>
<a
href="https://twitter.com/AdaLiteWallet"
href="https://x.com/AdaLiteWallet"
target="_blank"
rel="noopener"
className="social-link twitter"
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/components/common/infoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class InfoModal extends Component<Props, {dontShowAgainCheckbox: boolean; should
</li>
<li>
We'll announce new features on{' '}
<a href="https://twitter.com/nufi_official" target="_blank" rel="noopener">
<a href="https://x.com/nufiwallet" target="_blank" rel="noopener">
Twitter
</a>{' '}
and in our{' '}
Expand Down
7 changes: 1 addition & 6 deletions app/frontend/components/common/nufiBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import {h} from 'preact'

const NufiBanner = ({variant = 'static'}: {variant: 'static' | 'gif'}) => {
return (
<a
className="banner nufi"
href={`${window.location.origin}/nufi`}
rel="noopener"
target="blank"
>
<a className="banner nufi" href="https://nu.fi" rel="noopener" target="blank">
{variant === 'static' ? (
<img
src="assets/nufi-animated-banner-light.png"
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/components/common/nufiPageLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {h} from 'preact'

const NufiPageLink = () => {
return (
<a href="http://adalite.io/nufi" target="_blank" rel="noopener">
<a href="https://nu.fi" target="_blank" rel="noopener">
NuFi
</a>
)
Expand Down
11 changes: 0 additions & 11 deletions app/frontend/components/pages/accounts/accountsDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,6 @@ const AccountsDashboard = () => {
</p>
</Alert>
</div>
<div className="dashboard-column account info">
<Alert alertType="warning sidebar">
<p>
<b>
This feature is not supported on other wallets yet. If you decide to move your funds
to an account other than the first account, you will not see these funds in other
wallets such as Yoroi or Daedalus.
</b>
</p>
</Alert>
</div>
</Fragment>
)

Expand Down
15 changes: 9 additions & 6 deletions app/frontend/components/pages/delegations/shelleyBalances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,20 @@ const ShelleyBalances = ({
)}
</div>
{!!rewardsAccountBalance && (
<button
<span
{...tooltip(
'Cannot withdraw funds while transaction is pending or reloading',
shouldDisableSendingButton(walletOperationStatusType)
)}
className="button secondary balance withdraw"
onClick={withdrawRewards}
disabled={shouldDisableSendingButton(walletOperationStatusType)}
>
Withdraw
</button>
<button
className="button secondary balance withdraw"
onClick={withdrawRewards}
disabled={shouldDisableSendingButton(walletOperationStatusType)}
>
Withdraw
</button>
</span>
)}
</div>

Expand Down
7 changes: 1 addition & 6 deletions app/frontend/components/pages/login/loginPageSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ const InitialContent = () => (
<li>Get started in under 30 seconds</li>
</ul>
<div className="my-6">
<a
className="sidebar-link"
href={`${window.location.origin}/nufi`}
rel="noopener"
target="blank"
>
<a className="sidebar-link" href="https://nu.fi" rel="noopener" target="blank">
Learn more
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import tooltip from '../../common/tooltip'
import Alert from '../../common/alert'
import {
AssetFamily,
CertificateType,
DelegateTransactionSummary,
DeregisterStakingKeyTransactionSummary,
Lovelace,
Expand Down Expand Up @@ -234,6 +235,53 @@ const DeregisterStakeKeyReview = ({
)
}

const WithdrawDrepDelegationReview = ({
transactionSummary,
}: {
transactionSummary: TransactionSummary & WithdrawTransactionSummary
}) => {
assert(transactionSummary.plan != null)
const {rewards, fee} = transactionSummary
const total = rewards.minus(fee) as Lovelace
return (
<Fragment>
<Alert alertType="info">
<div className="mb-6">
In order to be a able to withdraw rewards, we first need you to make an empty delegation
to a DRep. You may later modify it using{' '}
<a href="https://nu.fi" target="_blank">
NuFi wallet
</a>{' '}
through{' '}
<a href="https://gov.tools" target="_blank">
https://gov.tools
</a>
.
</div>
<div>
Please sign this transaction and once it is submitted, you will be able to properly
withdraw your staking rewards.
</div>
</Alert>
<div className="review">
<div className="review-label">Address</div>
<div className="review-address">
{transactionSummary.plan.change[0].address}
<div className="review-address-verification">
<AddressVerification address={transactionSummary.plan.change[0].address} />
</div>
</div>
<div className="ada-label">Rewards</div>
<div className="review-value">{'N/A'}</div>
<div className="ada-label">Fee</div>
<div className="review-fee">{printAda(fee)}</div>
<div className="ada-label">Total</div>
<div className="review-total">{printAda(total)}</div>
</div>
</Fragment>
)
}

const WithdrawReview = ({
transactionSummary,
}: {
Expand All @@ -260,7 +308,6 @@ const WithdrawReview = ({
<div className="review-value">{printAda(rewards)}</div>
<div className="ada-label">Fee</div>
<div className="review-fee">{printAda(fee)}</div>
{/* TODO: Hide ADA symbol when handling tokens */}
<div className="ada-label">Total</div>
<div className="review-total">{printAda(total)}</div>
</div>
Expand Down Expand Up @@ -415,6 +462,13 @@ const ConfirmTransactionDialog = () => {
case TxType.CONVERT_LEGACY:
return <ConvertFundsReview transactionSummary={transactionSummary} />
case TxType.WITHDRAW:
if (
transactionSummary.plan?.certificates.find(
(cert) => cert.type === CertificateType.VOTE_DELEGATION
)
) {
return <WithdrawDrepDelegationReview transactionSummary={transactionSummary} />
}
return <WithdrawReview transactionSummary={transactionSummary} />
case TxType.SEND_ADA:
return (
Expand Down
8 changes: 5 additions & 3 deletions app/frontend/wallet/shelley/transaction/computeTxPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,12 @@ export const validateTxPlan = (txPlanResult: TxPlanResult): TxPlanResult => {
const isDeregisteringStakeKey = certificates.some(
(c) => c.type === CertificateType.STAKING_KEY_DEREGISTRATION
)
// Excluding deregistering stake key case
// because the returned "deposit" (2 ADA) is always higher than the Tx fee
if (
withdrawnRewards.gt(0) &&
// Excluding deregistering stake key case
// because the returned "deposit" (2 ADA) is always higher than the Tx fee
!isDeregisteringStakeKey &&
withdrawals.length > 0 &&
withdrawnRewards.gte(0) &&
!isDeregisteringStakeKey &&
(withdrawnRewards.lt(fee) || fee.gt(baseFee))
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,15 @@ const prepareTxPlanDraft = (txPlanArgs: TxPlanArgs): TxPlanDraft => {
}

const prepareWithdrawalTx = (txPlanArgs: WithdrawRewardsTxPlanArgs): TxPlanDraft => {
// note that if the user is not delegating to a DRep yet,
// we need to modify the tx to include a vote delegation.
// Moreover, the vote delegation cannot be done in the same tx
// hence we hack it by dropping the withdrawal and adding just the vote delegation

const withdrawals: TxWithdrawal[] = []
withdrawals.push({stakingAddress: txPlanArgs.stakingAddress, rewards: txPlanArgs.rewards})
if (txPlanArgs.hasVoteDelegation) {
withdrawals.push({stakingAddress: txPlanArgs.stakingAddress, rewards: txPlanArgs.rewards})
}

const certificates: TxCertificate[] = []
if (!txPlanArgs.hasVoteDelegation) {
Expand Down
18 changes: 7 additions & 11 deletions app/tests/src/common/tx-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export const transactionSettings = {
isChange: false as const,
address:
'addr1q8eakg39wqlye7lzyfmh900s2luc99zf7x9vs839pn4srjs2s3ps2plp2rc2qcgfmsa8kx2kk7s9s6hfq799tmcwpvpsjv0zk3' as Address,
coins: new BigNumber(13426611) as Lovelace,
coins: new BigNumber(8434301) as Lovelace,
tokenBundle: [],
},
{
Expand All @@ -352,20 +352,16 @@ export const transactionSettings = {
],
deposit: new BigNumber(0) as Lovelace,
additionalLovelaceAmount: new BigNumber(0) as Lovelace,
fee: new BigNumber(189879) as Lovelace,
baseFee: new BigNumber(189879) as Lovelace,
withdrawals: [
{
stakingAddress:
'stake1uy9ggsc9qls4pu9qvyyacwnmr9tt0gzcdt5s0zj4au8qkqc65geks' as Address,
rewards: new BigNumber(5000000) as Lovelace,
},
],
fee: new BigNumber(182189) as Lovelace,
baseFee: new BigNumber(182189) as Lovelace,
// withdrawals and vote delegation cannot be combined
// therefore this "withdrawal" tx has only the vote delegation
withdrawals: [],
auxiliaryData: null,
},
},
ttl,
txHash: '74cb7308c8017cc0104415062fa9ac9227816f0a4f35e733f6fa6e256da13bac',
txHash: 'acd01dca8aafcc158be820694c242563856e13ae85173e6d69d86881df27f7d8',
},
voting: {
args: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cardano",
"version": "6.15.0",
"version": "6.15.1",
"engines": {
"node": "20.11"
},
Expand Down Expand Up @@ -55,7 +55,7 @@
"compression": "^1.7.2",
"device": "^0.3.9",
"dotenv": "^6.0.0",
"express": "^4.16.3",
"express": "^4.21.2",
"express-basic-auth": "^1.2.0",
"express-ipfilter": "^1.1.2",
"express-mung": "^0.5.1",
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw=

cookie@0.6.0, cookie@^0.4.1, cookie@^0.7.0:
cookie@0.7.1, cookie@^0.4.1, cookie@^0.7.0:
version "0.7.2"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7"
integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==
Expand Down Expand Up @@ -3057,17 +3057,17 @@ express-mung@^0.5.1:
resolved "https://registry.yarnpkg.com/express-mung/-/express-mung-0.5.1.tgz#403ca3710745a208c676f1024314f1ead139919a"
integrity "sha1-QDyjcQdFogjGdvECQxTx6tE5kZo= sha512-5M8Oi2s9ePuP86YMyLT+hefWPPGxuxW3Vnuni/Hq3r2nGE0L4qulG0HkWuc4PIOpzZuZTwONwyfBFtR2xlnfgg=="

express@^4.16.3:
version "4.21.0"
resolved "https://registry.yarnpkg.com/express/-/express-4.21.0.tgz#d57cb706d49623d4ac27833f1cbc466b668eb915"
integrity "sha1-1Xy3BtSWI9SsJ4M/HLxGa2aOuRU= sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng=="
express@^4.21.2:
version "4.21.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32"
integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==
dependencies:
accepts "~1.3.8"
array-flatten "1.1.1"
body-parser "1.20.3"
content-disposition "0.5.4"
content-type "~1.0.4"
cookie "0.6.0"
cookie "0.7.1"
cookie-signature "1.0.6"
debug "2.6.9"
depd "2.0.0"
Expand All @@ -3081,7 +3081,7 @@ express@^4.16.3:
methods "~1.1.2"
on-finished "2.4.1"
parseurl "~1.3.3"
path-to-regexp "0.1.10"
path-to-regexp "0.1.12"
proxy-addr "~2.0.7"
qs "6.13.0"
range-parser "~1.2.1"
Expand Down Expand Up @@ -5150,9 +5150,9 @@ [email protected]:
integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==

nanoid@^3.3.6:
version "3.3.6"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
version "3.3.8"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf"
integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==

natural-compare@^1.4.0:
version "1.4.0"
Expand Down Expand Up @@ -5720,10 +5720,10 @@ path-scurry@^1.10.1:
lru-cache "^9.1.1 || ^10.0.0"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"

[email protected].10:
version "0.1.10"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b"
integrity "sha1-Z+kQjFwFUbnlMmBkOH3kdjxNX4s= sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w=="
[email protected].12:
version "0.1.12"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7"
integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==

path-type@^4.0.0:
version "4.0.0"
Expand Down
Loading