Skip to content

Commit 971c56b

Browse files
committed
Merge branch 'rippled-2.4.0' of https://github.com/XRPLF/xrpl-dev-portal into rippled-2.4.0
2 parents eef5714 + 6f86d66 commit 971c56b

File tree

284 files changed

+620
-9006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+620
-9006
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ yarn-error.log
77
/.idea
88
*.iml
99
.venv/
10-
1110
_code-samples/*/js/package-lock.json
1211

1312
# PHP

@l10n/ja/docs/references/protocol/transactions/transaction-results/tef-codes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ labels:
2828
| `tefINVARIANT_FAILED` | [トランザクションコスト](../../../../concepts/transactions/transaction-cost.md)を請求しようとしたところ、不変性チェックが失敗しました。[EnforceInvariants Amendment][]により追加されました。このエラーを再現できる場合は、[問題を報告](https://github.com/XRPLF/rippled/issues)してください。 |
2929
| `tefMASTER_DISABLED` | トランザクションはアカウントのマスターキーで署名されていましたが、アカウントに`lsfDisableMaster`フィールドが設定されていました。 |
3030
| `tefMAX_LEDGER` | トランザクションには[`LastLedgerSequence`](../../../../concepts/transactions/reliable-transaction-submission.md#lastledgersequence)パラメーターが指定されていましたが、現在のレジャーのシーケンス番号はすでに指定値を上回っています。 |
31-
| `tefNO_AUTH_REQUIRED` | [TrustSetトランザクション][]がトラストラインを承認済みとしてマークしようとしましたが、対応するアカウントに対して`lsfRequireAuth`フラグが有効になっていないため、承認は不要です|
31+
| `tefNO_AUTH_REQUIRED` | [TrustSetトランザクション][]で相手トラストラインを承認済みとしてマークしようとしましたが、自身のアカウントにおいて`lsfRequireAuth`フラグが有効になっていないため、承認できません|
3232
| `tefNOT_MULTI_SIGNING` | トランザクションは[マルチシグ](../../../../concepts/accounts/multi-signing.md)トランザクションでしたが、送信側アカウントでSignerListが定義されていません。 |
3333
| `tefPAST_SEQ` | トランザクションのシーケンス番号は、トランザクションの送信元アカウントの現在のシーケンス番号よりも小さい番号です。 |
3434
| `tefTOO_BIG` | レジャー内にある、トランザクションの影響を受けるオブジェクトが多過ぎます。例えば、これは[AccountDeleteトランザクション][]でしたが、削除されるアカウントのレジャーには1,000個を超えるオブジェクトがあります。 |

@theme/components/Navbar/Navbar.tsx

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,63 @@
11
import * as React from "react";
2-
import styled from "styled-components";
32
import { useThemeConfig, useThemeHooks } from "@redocly/theme/core/hooks";
43
import { LanguagePicker } from "@redocly/theme/components/LanguagePicker/LanguagePicker";
54
import { slugify } from "../../helpers";
65
import { Link } from "@redocly/theme/components/Link/Link";
76
import { ColorModeSwitcher } from "@redocly/theme/components/ColorModeSwitcher/ColorModeSwitcher";
87
import { AlgoliaSearch } from "./AlgoliaSearch";
8+
import arrowUpRight from "../../../static/img/icons/arrow-up-right-custom.svg";
99

1010
// @ts-ignore
1111

1212
const alertBanner = {
13-
show: false,
14-
message: "XRP Ledger Apex is back in Amsterdam",
15-
button: "Register Now",
16-
link: "https://www.xrpledgerapex.com/?utm_source=email&utm_medium=email_marketing&utm_campaign=EVENTS_XRPL_Apex_2024_Q2&utm_term=events_page_cta_button",
13+
show: true,
14+
message: "XRP LEDGER APEX 2025",
15+
button: "GET TICKETS",
16+
link: "https://www.xrpledgerapex.com/?utm_source=xrplwebsite&utm_medium=direct&utm_campaign=xrpl-event-ho-xrplapex-glb-2025-q1_xrplwebsite_ari_arp_bf_rsvp&utm_content=cta_btn_english_pencilbanner",
17+
date: "JUNE 10-12",
1718
};
19+
export function AlertBanner({ message, date, button, link, show }) {
20+
const { useTranslate } = useThemeHooks();
21+
const { translate } = useTranslate();
22+
const bannerRef = React.useRef(null);
23+
24+
React.useEffect(() => {
25+
const banner = bannerRef.current;
26+
if (!banner) return;
27+
const handleMouseEnter = () => {
28+
banner.classList.add('has-hover');
29+
};
30+
// Attach the event listener
31+
banner.addEventListener('mouseenter', handleMouseEnter);
32+
// Clean up the event listener on unmount
33+
return () => {
34+
banner.removeEventListener('mouseenter', handleMouseEnter);
35+
};
36+
}, []);
1837

38+
if (show) {
39+
return (
40+
<a
41+
href={link}
42+
target="_blank"
43+
ref={bannerRef}
44+
className="top-banner fixed-top web-banner"
45+
rel="noopener noreferrer"
46+
aria-label="Get Tickets for XRP Ledger Apex 2025 Event"
47+
>
48+
<div className="banner-event-details">
49+
<div className="event-info">{translate(message)}</div>
50+
<div className="event-date">{translate(date)}</div>
51+
</div>
52+
<div className="banner-button">
53+
<div className="button-text">{translate(button)}</div>
54+
<img className="button-icon" src={arrowUpRight} alt="Get Tickets Icon" />
55+
</div>
56+
</a>
57+
);
58+
}
59+
return null;
60+
}
1961
export function Navbar(props) {
2062
// const [isOpen, setIsOpen] = useMobileMenu(false);
2163
const themeConfig = useThemeConfig();
@@ -49,6 +91,7 @@ export function Navbar(props) {
4991
}
5092
});
5193

94+
5295
React.useEffect(() => {
5396
// Turns out jQuery is necessary for firing events on Bootstrap v4
5497
// dropdowns. These events set classes so that the search bar and other
@@ -86,12 +129,7 @@ export function Navbar(props) {
86129

87130
return (
88131
<>
89-
<AlertBanner
90-
show={alertBanner.show}
91-
message={alertBanner.message}
92-
button={alertBanner.button}
93-
link={alertBanner.link}
94-
/>
132+
<AlertBanner {...alertBanner} />
95133
<NavWrapper belowAlertBanner={alertBanner.show}>
96134
<LogoBlock to={href} img={logo} alt={altText} />
97135
<NavControls>
@@ -120,30 +158,6 @@ export function Navbar(props) {
120158
);
121159
}
122160

123-
const StyledColorModeSwitcher = styled(ColorModeSwitcher)`
124-
padding: 10px;
125-
`;
126-
127-
export function AlertBanner({ message, button, link, show }) {
128-
if (show) {
129-
return (
130-
<div className="top-banner fixed-top">
131-
<div className="inner-apex">
132-
<span>
133-
<p className="mb-0 apex-banner-text">{message}</p>
134-
</span>
135-
<span>
136-
<Link to={link} target="_blank" className="apex-btn">
137-
{button}
138-
</Link>
139-
</span>
140-
</div>
141-
</div>
142-
);
143-
}
144-
return null;
145-
}
146-
147161
export function TopNavCollapsible({ children }) {
148162
return (
149163
<div
@@ -268,7 +282,7 @@ export function NavWrapper(props) {
268282
return (
269283
<nav
270284
className="top-nav navbar navbar-expand-lg navbar-dark fixed-top"
271-
style={props.belowAlertBanner ? { marginTop: "46px" } : {}}
285+
style={props.belowAlertBanner ? { marginTop: "52px" } : {}}
272286
>
273287
{props.children}
274288
</nav>

_code-samples/build-a-browser-wallet/js/index.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,25 @@ txHistoryButton.addEventListener('click', () => {
3636
});
3737

3838
// Fetch the wallet details
39-
getWalletDetails({ client })
40-
.then(({ account_data, accountReserves, xAddress, address }) => {
41-
walletElement.querySelector('.wallet_address').textContent = `Wallet Address: ${account_data.Account}`;
42-
walletElement.querySelector('.wallet_balance').textContent = `Wallet Balance: ${dropsToXrp(account_data.Balance)} XRP`;
43-
walletElement.querySelector('.wallet_reserve').textContent = `Wallet Reserve: ${accountReserves} XRP`;
44-
walletElement.querySelector('.wallet_xaddress').textContent = `X-Address: ${xAddress}`;
39+
let wallet_details
40+
try {
41+
wallet_details = await getWalletDetails({ client })
42+
} catch(error) {
43+
alert(`Error loading wallet: ${error}.\n\nMake sure you set the SEED in your .env file.`)
44+
return
45+
}
46+
const { account_data, accountReserve, xAddress, address } = wallet_details;
47+
walletElement.querySelector('.wallet_address').textContent = `Wallet Address: ${account_data.Account}`;
48+
walletElement.querySelector('.wallet_balance').textContent = `Wallet Balance: ${dropsToXrp(account_data.Balance)} XRP`;
49+
walletElement.querySelector('.wallet_reserve').textContent = `Wallet Reserve: ${accountReserve} XRP`;
50+
walletElement.querySelector('.wallet_xaddress').textContent = `X-Address: ${xAddress}`;
4551

46-
// Redirect on View More link click
47-
walletElement.querySelector('#view_more_button').addEventListener('click', () => {
48-
window.open(`https://${process.env.EXPLORER_NETWORK}.xrpl.org/accounts/${address}`, '_blank');
49-
});
50-
})
51-
.finally(() => {
52-
walletLoadingDiv.style.display = 'none';
53-
});
52+
// Redirect on View More link click
53+
walletElement.querySelector('#view_more_button').addEventListener('click', () => {
54+
window.open(`https://${process.env.EXPLORER_NETWORK}.xrpl.org/accounts/${address}`, '_blank');
55+
});
56+
57+
walletLoadingDiv.style.display = 'none';
5458

5559

5660
// Fetch the latest ledger details

_code-samples/build-a-browser-wallet/js/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
"dev": "vite"
66
},
77
"devDependencies": {
8-
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
98
"crypto-browserify": "^3.12.0",
109
"events": "^3.3.0",
1110
"https-browserify": "^1.0.0",
12-
"rollup-plugin-polyfill-node": "^0.12.0",
1311
"stream-browserify": "^3.0.0",
1412
"stream-http": "^3.2.0",
15-
"vite": "^4.5.5"
13+
"vite": "^4.5.9"
1614
},
1715
"dependencies": {
1816
"dotenv": "^16.0.3",
Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
1-
import { Client, Wallet, classicAddressToXAddress } from 'xrpl';
1+
import { Wallet, classicAddressToXAddress } from 'xrpl';
22

33
export default async function getWalletDetails({ client }) {
4-
try {
5-
const wallet = Wallet.fromSeed(process.env.SEED); // Convert the seed to a wallet : https://xrpl.org/cryptographic-keys.html
4+
const wallet = Wallet.fromSeed(process.env.SEED);
65

7-
// Get the wallet details: https://xrpl.org/account_info.html
8-
const {
9-
result: { account_data },
10-
} = await client.request({
11-
command: 'account_info',
12-
account: wallet.address,
13-
ledger_index: 'validated',
14-
});
6+
// Get the wallet details
7+
const {
8+
result: { account_data },
9+
} = await client.request({
10+
command: 'account_info',
11+
account: wallet.address,
12+
ledger_index: 'validated',
13+
});
1514

16-
const ownerCount = account_data.OwnerCount || 0;
15+
const ownerCount = account_data.OwnerCount || 0;
1716

18-
// Get the reserve base and increment
19-
const {
20-
result: {
21-
info: {
22-
validated_ledger: { reserve_base_xrp, reserve_inc_xrp },
23-
},
17+
// Get the reserve base and increment
18+
const {
19+
result: {
20+
info: {
21+
validated_ledger: { reserve_base_xrp, reserve_inc_xrp },
2422
},
25-
} = await client.request({
26-
command: 'server_info',
27-
});
23+
},
24+
} = await client.request({
25+
command: 'server_info',
26+
});
2827

29-
// Calculate the reserves by multiplying the owner count by the increment and adding the base reserve to it.
30-
const accountReserves = ownerCount * reserve_inc_xrp + reserve_base_xrp;
28+
// Calculate the total reserve amount
29+
const accountReserve = ownerCount * reserve_inc_xrp + reserve_base_xrp;
3130

32-
console.log('Got wallet details!');
31+
console.log('Got wallet details!');
3332

34-
return {
35-
account_data,
36-
accountReserves,
37-
xAddress: classicAddressToXAddress(wallet.address, false, false), // Learn more: https://xrpaddress.info/
38-
address: wallet.address
39-
};
40-
} catch (error) {
41-
console.log('Error getting wallet details', error);
42-
return error;
43-
}
33+
return {
34+
account_data,
35+
accountReserve,
36+
xAddress: classicAddressToXAddress(wallet.address, false, false),
37+
address: wallet.address
38+
};
4439
}

_code-samples/build-a-browser-wallet/js/src/helpers/submit-transaction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { Wallet } from 'xrpl';
33
export default async function submitTransaction({ client, tx }) {
44
try {
55
// Create a wallet using the seed
6-
const wallet = await Wallet.fromSeed(process.env.SEED);
6+
const wallet = Wallet.fromSeed(process.env.SEED);
77
tx.Account = wallet.address;
88

9-
// Sign and submit the transaction : https://xrpl.org/send-xrp.html#send-xrp
9+
// Sign and submit the transaction
1010
const response = await client.submit(tx, { wallet });
1111
console.log(response);
1212

_code-samples/build-a-browser-wallet/js/src/send-xrp/send-xrp.js

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import submitTransaction from '../helpers/submit-transaction';
77
// Optional: Render the XRPL logo
88
renderXrplLogo();
99

10-
const client = new Client(process.env.CLIENT); // Get the client from the environment variables
10+
// Get the client from the environment variables
11+
const client = new Client(process.env.CLIENT);
1112

1213
// Self-invoking function to connect to the client
1314
(async () => {
1415
try {
15-
await client.connect(); // Connect to the client
16+
await client.connect();
1617

17-
const wallet = Wallet.fromSeed(process.env.SEED); // Convert the seed to a wallet : https://xrpl.org/cryptographic-keys.html
18+
const wallet = Wallet.fromSeed(process.env.SEED);
1819

1920
// Subscribe to account transaction stream
2021
await client.request({
@@ -23,8 +24,10 @@ const client = new Client(process.env.CLIENT); // Get the client from the enviro
2324
});
2425

2526
// Fetch the wallet details and show the available balance
26-
await getWalletDetails({ client }).then(({ accountReserves, account_data }) => {
27-
availableBalanceElement.textContent = `Available Balance: ${dropsToXrp(account_data.Balance) - accountReserves} XRP`;
27+
await getWalletDetails({ client }).then((
28+
{ accountReserve, account_data }) => {
29+
const bal = dropsToXrp(account_data.Balance) - accountReserve;
30+
availableBalanceElement.textContent = `Available Balance: ${bal} XRP`;
2831
});
2932

3033
} catch (error) {
@@ -58,9 +61,10 @@ txHistoryButton.addEventListener('click', () => {
5861

5962
// Update the account balance on successful transaction
6063
client.on('transaction', (response) => {
61-
if (response.validated && response.transaction.TransactionType === 'Payment') {
62-
getWalletDetails({ client }).then(({ accountReserves, account_data }) => {
63-
availableBalanceElement.textContent = `Available Balance: ${dropsToXrp(account_data.Balance) - accountReserves} XRP`;
64+
if (response.validated && response.tx_json.TransactionType === 'Payment') {
65+
getWalletDetails({ client }).then(({ accountReserve, account_data }) => {
66+
const bal = dropsToXrp(account_data.Balance) - accountReserve;
67+
availableBalanceElement.textContent = `Available Balance: ${bal} XRP`;
6468
});
6569
}
6670
});
@@ -113,23 +117,25 @@ submitTxBtn.addEventListener('click', async () => {
113117
submitTxBtn.disabled = true;
114118
submitTxBtn.textContent = 'Submitting...';
115119

116-
// Create the transaction object: https://xrpl.org/transaction-common-fields.html
120+
// Create the transaction object
117121
const txJson = {
118122
TransactionType: 'Payment',
119-
Amount: xrpToDrops(amount.value), // Convert XRP to drops: https://xrpl.org/basic-data-types.html#specifying-currency-amounts
123+
Amount: xrpToDrops(amount.value),
120124
Destination: destinationAddress.value,
121125
};
122126

123127
// Get the destination tag if it exists
124128
if (destinationTag?.value !== '') {
125-
txJson.DestinationTag = destinationTag.value;
129+
txJson.DestinationTag = parseInt(destinationTag.value);
126130
}
131+
console.log("Sending...", txJson);
127132

128133
// Submit the transaction to the ledger
129134
const { result } = await submitTransaction({ client, tx: txJson });
130-
const txResult = result?.meta?.TransactionResult || result?.engine_result || ''; // Response format: https://xrpl.org/transaction-results.html
135+
const txResult = result?.meta?.TransactionResult || result?.engine_result || '';
131136

132-
// Check if the transaction was successful or not and show the appropriate message to the user
137+
// Check if the transaction was successful or not
138+
// and show the appropriate message to the user
133139
if (txResult === 'tesSUCCESS') {
134140
alert('Transaction submitted successfully!');
135141
} else {
@@ -138,8 +144,10 @@ submitTxBtn.addEventListener('click', async () => {
138144
} catch (error) {
139145
alert('Error submitting transaction, Please try again.');
140146
console.error(error);
147+
submitTxBtn.disabled = false;
141148
} finally {
142-
// Re-enable the submit button after the transaction is submitted so the user can submit another transaction
149+
// Re-enable the submit button after the transaction is submitted
150+
// so the user can submit another transaction
143151
submitTxBtn.disabled = false;
144152
submitTxBtn.textContent = 'Submit Transaction';
145153
}

_code-samples/build-a-browser-wallet/js/src/transaction-history/transaction-history.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ async function fetchTxHistory() {
102102

103103
// Add the transactions to the table
104104
const values = transactions.map((transaction) => {
105-
const { meta, tx } = transaction;
105+
const { hash, meta, tx_json } = transaction;
106106
return {
107-
Account: tx.Account,
108-
Destination: tx.Destination,
109-
Fee: tx.Fee,
110-
Hash: tx.hash,
111-
TransactionType: tx.TransactionType,
107+
Account: tx_json.Account,
108+
Destination: tx_json.Destination,
109+
Fee: tx_json.Fee,
110+
Hash: hash,
111+
TransactionType: tx_json.TransactionType,
112112
result: meta?.TransactionResult,
113113
delivered: meta?.delivered_amount
114114
};

0 commit comments

Comments
 (0)