mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-12-06 17:27:57 +00:00
@@ -8,7 +8,7 @@
|
||||
"pbkdf2-hmac": "^1.1.0",
|
||||
"prompt": "^1.3.0",
|
||||
"qrcode": "^1.5.1",
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cryptography==43.0.1
|
||||
Pillow==10.3.0
|
||||
qrcode==7.2
|
||||
xrpl-py==3.0.0
|
||||
xrpl-py>=3.0.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0",
|
||||
"xrpl": "^4.0.0",
|
||||
"bignumber.js": "^9.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"dotenv": "^16.0.3",
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"pbkdf2-hmac": "^1.1.0",
|
||||
"open": "^8.4.0",
|
||||
"toml": "^3.0.0",
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "22.3.25"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
xrpl-py==2.0.0
|
||||
xrpl-py>=3.0.0
|
||||
wxPython==4.2.1
|
||||
toml==0.10.2
|
||||
requests==2.32.0
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
"version": "0.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
"dotenv": "^16.3.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2",
|
||||
"xrpl": "3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ async function main() {
|
||||
JSON.stringify(escrowCreateTransaction, null, "\t"), "\n"
|
||||
);
|
||||
const response = await client.submitAndWait(escrowCreateTransaction, { wallet });
|
||||
console.log(`Sequence number: ${response.result.Sequence}`);
|
||||
console.log(`Sequence number: ${response.result.tx_json.Sequence}`);
|
||||
console.log(`Finished submitting! ${JSON.stringify(response.result, null, "\t")}`);
|
||||
|
||||
await client.disconnect();
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"five-bells-condition": "*",
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ stxn_result = stxn_response.result
|
||||
|
||||
|
||||
# Parse result and print out the neccesary info
|
||||
print(stxn_result["Account"])
|
||||
print(stxn_result["Sequence"])
|
||||
print(stxn_result["tx_json"]["Account"])
|
||||
print(stxn_result["tx_json"]["Sequence"])
|
||||
|
||||
print(stxn_result["meta"]["TransactionResult"])
|
||||
print(stxn_result["hash"])
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
xrpl-py
|
||||
xrpl-py>=3.0.0
|
||||
cryptoconditions
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
"version": "0.1.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
xrpl-py
|
||||
xrpl-py>=3.0.0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Code Sample - Issue a Token</title>
|
||||
<script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js"></script>
|
||||
<script src="https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js"></script>
|
||||
<script type="application/javascript" src="issue-a-token.js"></script>
|
||||
</head>
|
||||
<body>Open your browser's console (F12) to see the logs.</body>
|
||||
|
||||
@@ -145,7 +145,7 @@ async function main() {
|
||||
const send_token_tx = {
|
||||
"TransactionType": "Payment",
|
||||
"Account": cold_wallet.address,
|
||||
"Amount": {
|
||||
"DeliverMax": {
|
||||
"currency": currency_code,
|
||||
"value": issue_quantity,
|
||||
"issuer": cold_wallet.address
|
||||
@@ -171,7 +171,7 @@ async function main() {
|
||||
const send_token_tx2 = {
|
||||
"TransactionType": "Payment",
|
||||
"Account": hot_wallet.address,
|
||||
"Amount": {
|
||||
"DeliverMax": {
|
||||
"currency": currency_code,
|
||||
"value": issue_quantity,
|
||||
"issuer": cold_wallet.address
|
||||
@@ -197,7 +197,7 @@ async function main() {
|
||||
const send_token_tx3 = {
|
||||
"TransactionType": "Payment",
|
||||
"Account": customer_one_wallet.address,
|
||||
"Amount": {
|
||||
"DeliverMax": {
|
||||
"currency": currency_code,
|
||||
"value": issue_quantity,
|
||||
"issuer": cold_wallet.address
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"ripple-address-codec": "^5.0.0",
|
||||
"ripple-keypairs": "^2.0.0",
|
||||
"secp256k1": "^5.0.0",
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -82,8 +82,8 @@ async function do_subscribe() {
|
||||
}
|
||||
|
||||
const log_tx = function(tx) {
|
||||
console.log(tx.transaction.TransactionType + " transaction sent by " +
|
||||
tx.transaction.Account +
|
||||
console.log(tx.tx_json.TransactionType + " transaction sent by " +
|
||||
tx.tx_json.Account +
|
||||
"\n Result: " + tx.meta.TransactionResult +
|
||||
" in ledger " + tx.ledger_index +
|
||||
"\n Validated? " + tx.validated)
|
||||
|
||||
@@ -51,8 +51,8 @@ function CountXRPReceived(tx, address) {
|
||||
console.log("Transaction failed.")
|
||||
return
|
||||
}
|
||||
if (tx.transaction.TransactionType === "Payment") {
|
||||
if (tx.transaction.Destination !== address) {
|
||||
if (tx.tx_json.TransactionType === "Payment") {
|
||||
if (tx.tx_json.Destination !== address) {
|
||||
console.log("Not the destination of this payment.")
|
||||
return
|
||||
}
|
||||
@@ -67,10 +67,10 @@ function CountXRPReceived(tx, address) {
|
||||
}
|
||||
} else if (["PaymentChannelClaim", "PaymentChannelFund", "OfferCreate",
|
||||
"CheckCash", "EscrowFinish"].includes(
|
||||
tx.transaction.TransactionType)) {
|
||||
tx.tx_json.TransactionType)) {
|
||||
CountXRPDifference(tx.meta.AffectedNodes, address)
|
||||
} else {
|
||||
console.log("Not a currency-delivering transaction type (" +
|
||||
tx.transaction.TransactionType + ").")
|
||||
tx.tx_json.TransactionType + ").")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,21 +53,21 @@ def CountXRPReceived(tx, address):
|
||||
if tx['meta']['TransactionResult'] != 'tesSUCCESS':
|
||||
print("Transaction failed")
|
||||
return
|
||||
if tx['transaction']['TransactionType'] == 'Payment':
|
||||
if tx['transaction']['Destination'] != address:
|
||||
if tx['tx_json']['TransactionType'] == 'Payment':
|
||||
if tx['tx_json']['Destination'] != address:
|
||||
print("Not the destination of this payment.")
|
||||
return
|
||||
if tx['meta']['delivered_amount'] is int or str:
|
||||
amount_in_drops = int(tx['transaction']['Amount'])
|
||||
amount_in_drops = int(tx['tx_json']['DeliverMax'])
|
||||
xrp_amount = (amount_in_drops / 1000000)
|
||||
print(f"Received {xrp_amount} XRP")
|
||||
return
|
||||
else:
|
||||
print("Received non-XRP currency")
|
||||
elif tx['transaction']['TransactionType'] == 'PaymentChannelClaim' or 'PaymentChannelFund' or'OfferCreate' or 'CheckCash' or 'EscrowFinish':
|
||||
elif tx['tx_json']['TransactionType'] == 'PaymentChannelClaim' or 'PaymentChannelFund' or'OfferCreate' or 'CheckCash' or 'EscrowFinish':
|
||||
FindXRPDifference(tx, address)
|
||||
else:
|
||||
print("Not a currency-delivering transaction type", tx['transaction']['TransactionType'])
|
||||
print("Not a currency-delivering transaction type", tx['tx_json']['TransactionType'])
|
||||
|
||||
CountXRPReceived(tx=transaction, address='rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe')
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script>
|
||||
if (typeof module !== "undefined") {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex10-check.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex11-create-amm.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex11-create-amm.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='https://unpkg.com/bignumber.js@9.1.2/bignumber.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex3-mint-nfts.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex3a-create-offers.js'></script>
|
||||
<script src='ripplex3b-NameFieldSupport.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex3-mint-nfts.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex3-mint-nfts.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex3-mint-nfts.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex3-mint-nfts.js'></script>
|
||||
<script src='ripplex7-batch-minting.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex8-escrow.js'></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
button{font-weight: bold;font-family: "Work Sans", sans-serif;}
|
||||
td{vertical-align: middle;}
|
||||
</style>
|
||||
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||
<script src='https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js'></script>
|
||||
<script src='ripplex1-send-xrp.js'></script>
|
||||
<script src='ripplex2-send-currency.js'></script>
|
||||
<script src='ripplex8-escrow.js'></script>
|
||||
|
||||
@@ -128,7 +128,7 @@ async function sendXRP() {
|
||||
const prepared = await client.autofill({
|
||||
"TransactionType": "Payment",
|
||||
"Account": standby_wallet.address,
|
||||
"Amount": xrpl.xrpToDrops(sendAmount),
|
||||
"DeliverMax": xrpl.xrpToDrops(sendAmount),
|
||||
"Destination": standbyDestinationField.value
|
||||
})
|
||||
|
||||
@@ -178,7 +178,7 @@ async function oPsendXRP() {
|
||||
const prepared = await client.autofill({
|
||||
"TransactionType": "Payment",
|
||||
"Account": operational_wallet.address,
|
||||
"Amount": xrpl.xrpToDrops(operationalAmountField.value),
|
||||
"DeliverMax": xrpl.xrpToDrops(operationalAmountField.value),
|
||||
"Destination": operationalDestinationField.value
|
||||
})
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ async function sendCurrency() {
|
||||
const send_token_tx = {
|
||||
"TransactionType": "Payment",
|
||||
"Account": standby_wallet.address,
|
||||
"Amount": {
|
||||
"DeliverMax": {
|
||||
"currency": standbyCurrencyField.value,
|
||||
"value": standbyAmountField.value,
|
||||
"issuer": standby_wallet.address
|
||||
@@ -249,7 +249,7 @@ async function oPsendCurrency() {
|
||||
const send_token_tx = {
|
||||
"TransactionType": "Payment",
|
||||
"Account": operational_wallet.address,
|
||||
"Amount": {
|
||||
"DeliverMax": {
|
||||
"currency": currency_code,
|
||||
"value": issue_quantity,
|
||||
"issuer": operational_wallet.address
|
||||
|
||||
@@ -136,7 +136,7 @@ async function sendXRP() {
|
||||
const prepared = await client.autofill({
|
||||
"TransactionType": "Payment",
|
||||
"Account": standby_wallet.address,
|
||||
"Amount": xrpl.xrpToDrops(sendAmount),
|
||||
"DeliverMax": xrpl.xrpToDrops(sendAmount),
|
||||
"Destination": standbyDestinationField.value
|
||||
})
|
||||
|
||||
@@ -186,7 +186,7 @@ async function oPsendXRP() {
|
||||
const prepared = await client.autofill({
|
||||
"TransactionType": "Payment",
|
||||
"Account": operational_wallet.address,
|
||||
"Amount": xrpl.xrpToDrops(sendAmount),
|
||||
"DeliverMax": xrpl.xrpToDrops(sendAmount),
|
||||
"Destination": operationalDestinationField.value
|
||||
})
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js"></script>
|
||||
<script src="https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js"></script>
|
||||
<script type="application/javascript" src="require-destination-tags.js"></script>
|
||||
</head>
|
||||
<body>Open your browser's console (F12) to see the logs.</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const txJSON = {
|
||||
"Account": my_wallet.address,
|
||||
"TransactionType":"Payment",
|
||||
"Destination":"rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Amount":"13000000",
|
||||
"DeliverMax":"13000000",
|
||||
"Flags":2147483648,
|
||||
"LastLedgerSequence":7835923, // Optional, but recommended.
|
||||
"Fee":"13",
|
||||
@@ -25,4 +25,4 @@ const txJSON = {
|
||||
const signed = my_wallet.sign(txJSON)
|
||||
|
||||
console.log("tx_blob is:", signed.tx_blob)
|
||||
console.log("tx hash is:", signed.hash)
|
||||
console.log("tx hash is:", signed.tx_json.hash)
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
"author": "",
|
||||
"license": "CC0-1.0",
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ if (typeof module !== "undefined") {
|
||||
"TransactionType": "Payment",
|
||||
"Account": wallet.address,
|
||||
"Destination": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||
"Amount": "1000000", // Amount in drops, 1 XRP = 1,000,000 drops
|
||||
"DeliverMax": "1000000", // Amount in drops, 1 XRP = 1,000,000 drops
|
||||
"Memos": [{
|
||||
"Memo":{
|
||||
"MemoType": MemoType,
|
||||
@@ -45,9 +45,9 @@ if (typeof module !== "undefined") {
|
||||
console.log("Submitting a payment transaction with our memo field...")
|
||||
const submit_result = await client.submitAndWait(signed.tx_blob)
|
||||
xrpl.convertHexToString
|
||||
const tx_MemoData = xrpl.convertHexToString(string=submit_result.result.Memos[0].Memo.MemoData);
|
||||
const tx_MemoFormat = xrpl.convertHexToString(string=submit_result.result.Memos[0].Memo.MemoFormat);
|
||||
const tx_MemoType = xrpl.convertHexToString(string=submit_result.result.Memos[0].Memo.MemoType);
|
||||
const tx_MemoData = xrpl.convertHexToString(string=submit_result.result.tx_json.Memos[0].Memo.MemoData);
|
||||
const tx_MemoFormat = xrpl.convertHexToString(string=submit_result.result.tx_json.Memos[0].Memo.MemoFormat);
|
||||
const tx_MemoType = xrpl.convertHexToString(string=submit_result.result.tx_json.Memos[0].Memo.MemoType);
|
||||
|
||||
console.log(`\n Encoded Transaction MEMO: ${JSON.stringify({"MemoType": MemoType, "MemoData": MemoData, "MemoFormat": MemoFormat})}`)
|
||||
console.log(` Decoded Transaction MEMO: ${JSON.stringify({"MemoType": tx_MemoType, "MemoData": tx_MemoData, "MemoFormat": tx_MemoFormat})}`);
|
||||
|
||||
@@ -49,9 +49,9 @@ print(f"\n Encoded Transaction MEMO: {payment_tx_signed.memos}")
|
||||
submit_tx_regular = submit_and_wait(transaction=payment_tx_signed, client=client)
|
||||
submit_tx_regular = submit_tx_regular.result
|
||||
|
||||
tx_MemoData = bytes.fromhex(submit_tx_regular['Memos'][0]['Memo']['MemoData']).decode('utf-8')
|
||||
tx_MemoFormat = bytes.fromhex(submit_tx_regular['Memos'][0]['Memo']['MemoFormat']).decode('utf-8')
|
||||
tx_MemoType = bytes.fromhex(submit_tx_regular['Memos'][0]['Memo']['MemoType']).decode('utf-8')
|
||||
tx_MemoData = bytes.fromhex(submit_tx_regular['tx_json']['Memos'][0]['Memo']['MemoData']).decode('utf-8')
|
||||
tx_MemoFormat = bytes.fromhex(submit_tx_regular['tx_json']['Memos'][0]['Memo']['MemoFormat']).decode('utf-8')
|
||||
tx_MemoType = bytes.fromhex(submit_tx_regular['tx_json']['Memos'][0]['Memo']['MemoType']).decode('utf-8')
|
||||
|
||||
print(f" Decoded Transaction MEMO:")
|
||||
print(f" MemoData: {tx_MemoData}")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Code Sample - Send XRP</title>
|
||||
<script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js"></script>
|
||||
<script src="https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js"></script>
|
||||
<script type="application/javascript" src="send-xrp.js"></script>
|
||||
</head>
|
||||
<body>Open your browser's console (F12) to see the logs.</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ async function main() {
|
||||
const prepared = await client.autofill({
|
||||
"TransactionType": "Payment",
|
||||
"Account": wallet.address,
|
||||
"Amount": xrpl.xrpToDrops("22"),
|
||||
"DeliverMax": xrpl.xrpToDrops("22"),
|
||||
"Destination": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"
|
||||
})
|
||||
const max_ledger = prepared.LastLedgerSequence
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Code Sample - Trade in the Decentralized Exchange</title>
|
||||
<script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js"></script>
|
||||
<script src="https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js"></script>
|
||||
<script src='https://cdn.jsdelivr.net/npm/bignumber.js@9.0.2/bignumber.min.js'></script>
|
||||
<script type="application/javascript" src="trade-in-the-dex.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0",
|
||||
"xrpl": "^4.0.0",
|
||||
"bignumber.js": "^9.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"fs": "^0.0.1-security",
|
||||
"minimist": "^1.2.7",
|
||||
"ripple-address-codec": "^5.0.0",
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Code Sample - Use Tickets</title>
|
||||
<script src="https://unpkg.com/xrpl@2.0.0/build/xrpl-latest-min.js"></script>
|
||||
<script src="https://unpkg.com/xrpl@4.0.0/build/xrpl-latest.js"></script>
|
||||
<script type="application/javascript" src="use-tickets.js"></script>
|
||||
</head>
|
||||
<body>Open your browser's console (F12) to see the logs.</body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"xrpl": "^3.0.0"
|
||||
"xrpl": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ Typically, we create XRP Ledger transactions as objects in the JSON [transaction
|
||||
{
|
||||
"TransactionType": "Payment",
|
||||
"Account": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||
"Amount": "2000000",
|
||||
"DeliverMax": "2000000",
|
||||
"Destination": "rUCzEr6jrEyMpjhs4wSdQdz4g8Y382NxfM"
|
||||
}
|
||||
```
|
||||
@@ -112,7 +112,7 @@ The bare minimum set of instructions you must provide for an XRP Payment is:
|
||||
- An indicator that this is a payment. (`"TransactionType": "Payment"`)
|
||||
- The sending address. (`"Account"`)
|
||||
- The address that should receive the XRP (`"Destination"`). This can't be the same as the sending address.
|
||||
- The amount of XRP to send (`"Amount"`). Typically, this is specified as an integer in "drops" of XRP, where 1,000,000 drops equals 1 XRP.
|
||||
- The amount of XRP to send (`"DeliverMax"`). Typically, this is specified as an integer in "drops" of XRP, where 1,000,000 drops equals 1 XRP.
|
||||
|
||||
Technically, a transaction must contain some additional fields, and certain optional fields such as `LastLedgerSequence` are strongly recommended. Some other language-specific notes:
|
||||
|
||||
|
||||
28
package-lock.json
generated
28
package-lock.json
generated
@@ -2783,33 +2783,6 @@
|
||||
"resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
|
||||
"integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="
|
||||
},
|
||||
"node_modules/cross-fetch": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz",
|
||||
"integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==",
|
||||
"dependencies": {
|
||||
"node-fetch": "^2.6.12"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-fetch/node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/crypto-js": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
|
||||
@@ -6898,6 +6871,7 @@
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xrpl/-/xrpl-4.0.0.tgz",
|
||||
"integrity": "sha512-VZm1lQWHQ6PheAAFGdH+ISXKvqB2hZDQ0w4ZcdAEtmqZQXtSIVQHOKPz95rEgGANbos7+XClxJ73++joPhA8Cw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@scure/bip32": "^1.3.1",
|
||||
"@scure/bip39": "^1.2.1",
|
||||
|
||||
Reference in New Issue
Block a user