mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-12-01 17:15:51 +00:00
Add account configuration topic
Create a new Account Configuration topic, including the Account Configurator example.
This commit is contained in:
309
_code-samples/account-configurator/account-configurator.html
Normal file
309
_code-samples/account-configurator/account-configurator.html
Normal file
@@ -0,0 +1,309 @@
|
|||||||
|
<html>
|
||||||
|
<!-- Add Signers list -->
|
||||||
|
<head>
|
||||||
|
<title>Account Configurator</title>
|
||||||
|
<link href='https://fonts.googleapis.com/css?family=Work Sans' rel='stylesheet'>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: "Inter", sans-serif;
|
||||||
|
padding: 20px;
|
||||||
|
background: #abe2ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
button {
|
||||||
|
padding: 6px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
border: none
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "Work Sans", sans-serif;
|
||||||
|
background-color: #006aff;
|
||||||
|
-webkit-text-fill-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
td {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src='https://unpkg.com/xrpl@2.7.0/build/xrpl-latest-min.js'></script>
|
||||||
|
<script src='account-configurator.js'></script>
|
||||||
|
<script>
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
const xrpl = require('xrpl')
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<!-- ************************************************************** -->
|
||||||
|
<!-- ********************** The Form ****************************** -->
|
||||||
|
<!-- ************************************************************** -->
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>Account Configurator</h1>
|
||||||
|
<form id="theForm">
|
||||||
|
Choose your ledger instance:
|
||||||
|
|
||||||
|
<input type="radio" id="mn" name="server" value="wss://xrplcluster.com/">
|
||||||
|
<label for="mainnet">Mainnet</label>
|
||||||
|
|
||||||
|
<input type="radio" id="tn" name="server" value="wss://s.altnet.rippletest.net:51233" checked>
|
||||||
|
<label for="testnet">Testnet</label>
|
||||||
|
|
||||||
|
<input type="radio" id="dn" name="server" value="wss://s.devnet.rippletest.net:51233">
|
||||||
|
<label for="devnet">Devnet</label><br />
|
||||||
|
<table>
|
||||||
|
<tr valign="top">
|
||||||
|
<td>
|
||||||
|
<table>
|
||||||
|
<tr valign="top">
|
||||||
|
<td align="right">
|
||||||
|
Account
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="accountField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button type="button" onClick="getAccount()">Get New Account</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">
|
||||||
|
Seed
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="seedField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button type="button" onClick="getAccountFromSeed()">Get Account From Seed</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button type="button" onClick="getAccountInfo()">Get Account Info</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Account Configuration Templates:
|
||||||
|
|
||||||
|
<input type="radio" id="hd" name="accountType" value="hd" onclick="setHolder()">
|
||||||
|
<label for="hd" background="green">Holder</label>
|
||||||
|
|
||||||
|
<input type="radio" id="ex" name="accountType" value="ex" onclick="setExchanger()">
|
||||||
|
<label for="ex">Exchanger</label>
|
||||||
|
|
||||||
|
<input type="radio" id="is" name="accountType" value="is" onclick="setIssuer()">
|
||||||
|
<label for="issuer">Issuer</label>
|
||||||
|
|
||||||
|
<button type="button" onClick="configureAccount()">Configure Account</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</td>
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div id="issuer_additional_fields">
|
||||||
|
<table>
|
||||||
|
<tr valign="top">
|
||||||
|
<td align="right">
|
||||||
|
Domain
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="domainField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
A web address.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">
|
||||||
|
Transfer Rate
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="transferRateField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
A value between 1000000000 and 2000000000, inclusive.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">
|
||||||
|
Tick Size
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="tickSizeField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Valid values are 3 to 15, inclusive, or 0 to disable.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">
|
||||||
|
Signer1 Account
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="signer1AccountField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>Signer1 Weight
|
||||||
|
<input type="text" id="signer1WeightField" size="5"></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button type="button" onClick="removeSigners()">Remove Signers</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">
|
||||||
|
Signer2 Account
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="signer2AccountField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>Signer2 Weight
|
||||||
|
<input type="text" id="signer2WeightField" size="5"></input>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="right">
|
||||||
|
Signer3 Account</td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="signer3AccountField" size="40"></input>
|
||||||
|
</td>
|
||||||
|
<td>Signer3 Weight
|
||||||
|
<input type="text" id="signer3WeightField" size="5"></input>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
</td>
|
||||||
|
<td>Signer Quorum
|
||||||
|
<input type="text" id="signerQuorumField" size="5"></input>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="account_flags">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
defaultRipple
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='checkbox' id="defaultRipple"></input></br>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Allow rippling on trust lines by default.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
allowTrustLineClawback
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='checkbox' id='allowTrustLineClawback'></input></br>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Allow clawback of tokens on trust lines to the account.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
depositAuth
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='checkbox' id='depositAuth'></input></br>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Use Deposit Authorization to deny payments from unknown third parties.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
disableMasterKey
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type='checkbox' id='disableMasterKey'></input>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Disable the account master key pair.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disallowIncomingCheck</td>
|
||||||
|
<td><input type='checkbox' id='disallowIncomingCheck'></input></td>
|
||||||
|
<td>Prevent other accounts from sending checks to the account.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disallowIncomingNFTokenOffer</td>
|
||||||
|
<td><input type='checkbox' id='disallowIncomingNFTokenOffer'></input></td>
|
||||||
|
<td>Prevent other accounts from sending NFT buy or sell offers to the account.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disallowIncomingPayChan</td>
|
||||||
|
<td><input type='checkbox' id='disallowIncomingPayChan'></input></td>
|
||||||
|
<td>Prevent other accounts from creating payment channels to the account.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disallowIncomingTrustline</td>
|
||||||
|
<td><input type='checkbox' id='disallowIncomingTrustline'></input></td>
|
||||||
|
<td>Prevent other accounts from creating trust lines to the account.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>disallowIncomingXRP</td>
|
||||||
|
<td><input type='checkbox' id='disallowIncomingXRP'></input></td>
|
||||||
|
<td>Prevent other accounts from sending XRP to the account. (This is advisory, and not enforced at the protocol
|
||||||
|
level.)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>globalFreeze</td>
|
||||||
|
<td><input type='checkbox' id='globalFreeze'></input></td>
|
||||||
|
<td>Freeze all tokens issued by the account.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>noFreeze</td>
|
||||||
|
<td><input type='checkbox' id='noFreeze'></input></td>
|
||||||
|
<td>Permanently remove the ability to freeze individual trust lines or end a global freeze.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>requireAuthorization</td>
|
||||||
|
<td><input type='checkbox' id='requireAuthorization'></input></td>
|
||||||
|
<td>The account requires authorized trust lines for other accounts to hold tokens it issues.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>requireDestinationTag</td>
|
||||||
|
<td><input type='checkbox' id='requireDestinationTag'></input></td>
|
||||||
|
<td>The account requires a destination tag on all payments it receives.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<textarea id="resultField" cols="80" rows="15"></textarea>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
473
_code-samples/account-configurator/account-configurator.js
Normal file
473
_code-samples/account-configurator/account-configurator.js
Normal file
@@ -0,0 +1,473 @@
|
|||||||
|
const allFlags = [
|
||||||
|
"empty",
|
||||||
|
"asfRequireDest",
|
||||||
|
"asfRequireAuth",
|
||||||
|
"asfDisallowXRP",
|
||||||
|
"asfDisableMaster",
|
||||||
|
"asfAccountTxnID",
|
||||||
|
"asfNoFreeze",
|
||||||
|
"asfGlobalFreeze",
|
||||||
|
"asfDefaultRipple",
|
||||||
|
"asfDepositAuth",
|
||||||
|
"asfAuthorizedNFTokenMinter",
|
||||||
|
"hooksReserved",
|
||||||
|
"asfDisallowIncomingNFTokenOffer",
|
||||||
|
"asfDisallowIncomingCheck",
|
||||||
|
"asfDisallowIncomingPayChan",
|
||||||
|
"asfDisallowIncomingTrustline",
|
||||||
|
"asfAllowTrustLineClawback",
|
||||||
|
]
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
document.getElementById("issuer_additional_fields").style.display="none"
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// ******************************************************
|
||||||
|
// ************* Get the Preferred Network **************
|
||||||
|
// ******************************************************
|
||||||
|
|
||||||
|
function getNet() {
|
||||||
|
let net
|
||||||
|
if (document.getElementById("mn").checked) net = "wss://xrplcluster.com/"
|
||||||
|
if (document.getElementById("tn").checked) net = "wss://s.altnet.rippletest.net:51233"
|
||||||
|
if (document.getElementById("dn").checked) net = "wss://s.devnet.rippletest.net:51233"
|
||||||
|
return net
|
||||||
|
} // End of getNet()
|
||||||
|
|
||||||
|
// *******************************************************
|
||||||
|
// ************* Get Account *****************************
|
||||||
|
// *******************************************************
|
||||||
|
|
||||||
|
async function getAccount() {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
results = 'Connecting to ' + net + '....'
|
||||||
|
|
||||||
|
//-------------------------------This uses the default faucet for Testnet/Devnet.
|
||||||
|
let faucetHost = null
|
||||||
|
resultField.value = results
|
||||||
|
await client.connect()
|
||||||
|
results += '\nConnected, funding wallet.'
|
||||||
|
// ----------------------------------------Create and fund a test account wallet.
|
||||||
|
const my_wallet = (await client.fundWallet(null, { faucetHost })).wallet
|
||||||
|
results += '\nGot a wallet.'
|
||||||
|
|
||||||
|
// ------------------------------------------------------Get the current balance.
|
||||||
|
const my_balance = (await client.getXrpBalance(my_wallet.address))
|
||||||
|
accountField.value = my_wallet.address
|
||||||
|
seedField.value = my_wallet.seed
|
||||||
|
results += '\nAccount created.'
|
||||||
|
resultField.value = results
|
||||||
|
client.disconnect()
|
||||||
|
getAccountInfo()
|
||||||
|
} // End of getAccount()
|
||||||
|
|
||||||
|
// *******************************************************
|
||||||
|
// ************ Get Account from Seed ********************
|
||||||
|
// *******************************************************
|
||||||
|
|
||||||
|
async function getAccountFromSeed() {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
results = 'Connecting to ' + getNet() + '....'
|
||||||
|
await client.connect()
|
||||||
|
results += '\nConnected, finding wallets.\n'
|
||||||
|
resultField.value = results
|
||||||
|
// --------------------------------------------------Find the test account wallet.
|
||||||
|
const my_wallet = xrpl.Wallet.fromSeed(seedField.value)
|
||||||
|
|
||||||
|
// -------------------------------------------------------Get the current balance.
|
||||||
|
accountField.value = my_wallet.address
|
||||||
|
seedField.value = my_wallet.seed
|
||||||
|
client.disconnect()
|
||||||
|
getAccountInfo()
|
||||||
|
} // End of getAccountFromSeed()
|
||||||
|
|
||||||
|
// *******************************************************
|
||||||
|
// ***************** Get Account Info ********************
|
||||||
|
// *******************************************************
|
||||||
|
|
||||||
|
async function getAccountInfo() {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
results = 'Connecting to ' + getNet() + '....'
|
||||||
|
await client.connect()
|
||||||
|
results += '\nConnected.'
|
||||||
|
results+= "\nGetting account info...\n"
|
||||||
|
const my_acct_info = await client.request({
|
||||||
|
command: "account_info",
|
||||||
|
account: accountField.value,
|
||||||
|
ledger_index: "validated",
|
||||||
|
signer_lists: true
|
||||||
|
})
|
||||||
|
results = JSON.stringify(my_acct_info, null, 2)
|
||||||
|
resultField.value += results
|
||||||
|
var parsedResults = JSON.parse(results)
|
||||||
|
document.getElementById("tickSizeField").value = parsedResults.result.account_data.TickSize
|
||||||
|
document.getElementById("transferRateField").value = parsedResults.result.account_data.TransferRate
|
||||||
|
document.getElementById("domainField").value = parsedResults.result.account_data.Domain
|
||||||
|
document.getElementById("defaultRipple").checked = parsedResults.result.account_flags.defaultRipple
|
||||||
|
document.getElementById("allowTrustLineClawback").checked = parsedResults.result.account_flags.allowTrustLineClawback
|
||||||
|
document.getElementById("depositAuth").checked = parsedResults.result.account_flags.depositAuth
|
||||||
|
document.getElementById("disableMasterKey").checked = parsedResults.result.account_flags.disableMasterKey
|
||||||
|
document.getElementById("disallowIncomingCheck").checked = parsedResults.result.account_flags.disallowIncomingCheck
|
||||||
|
document.getElementById("disallowIncomingNFTokenOffer").checked = parsedResults.result.account_flags.disallowIncomingNFTokenOffer
|
||||||
|
document.getElementById("disallowIncomingPayChan").checked = parsedResults.result.account_flags.disallowIncomingPayChan
|
||||||
|
document.getElementById("disallowIncomingTrustline").checked = parsedResults.result.account_flags.disallowIncomingTrustline
|
||||||
|
document.getElementById("disallowIncomingXRP").checked = parsedResults.result.account_flags.disallowIncomingXRP
|
||||||
|
document.getElementById("globalFreeze").checked = parsedResults.result.account_flags.globalFreeze
|
||||||
|
document.getElementById("noFreeze").checked = parsedResults.result.account_flags.noFreeze
|
||||||
|
document.getElementById("requireAuthorization").checked = parsedResults.result.account_flags.requireAuthorization
|
||||||
|
document.getElementById("requireDestinationTag").checked = parsedResults.result.account_flags.requireDestinationTag
|
||||||
|
try {
|
||||||
|
let signerEntries_variable = parsedResults.result.account_data.signer_lists[0].SignerEntries
|
||||||
|
document.getElementById("signer1AccountField").value = signerEntries_variable[0]["SignerEntry"]["Account"]
|
||||||
|
document.getElementById("signer1WeightField").value = signerEntries_variable[0]["SignerEntry"]["SignerWeight"]
|
||||||
|
document.getElementById("signer2AccountField").value = signerEntries_variable[1]["SignerEntry"]["Account"]
|
||||||
|
document.getElementById("signer2WeightField").value = signerEntries_variable[1]["SignerEntry"]["SignerWeight"]
|
||||||
|
document.getElementById("signer3AccountField").value = signerEntries_variable[2]["SignerEntry"]["Account"]
|
||||||
|
document.getElementById("signer3WeightField").value = signerEntries_variable[2]["SignerEntry"]["SignerWeight"]
|
||||||
|
document.getElementById("signerQuorumField").value = parsedResults.result.account_data.signer_lists[0].SignerQuorum
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
client.disconnect()
|
||||||
|
} // End of getAccountInfo()
|
||||||
|
|
||||||
|
// *******************************************************
|
||||||
|
// **************** Configure Account ********************
|
||||||
|
// *******************************************************
|
||||||
|
|
||||||
|
async function configureAccount() {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
resultField.value = `Connecting to ${net}.`
|
||||||
|
await client.connect()
|
||||||
|
my_wallet = xrpl.Wallet.fromSeed(seedField.value)
|
||||||
|
const my_acct_info = await client.request({
|
||||||
|
command: "account_info",
|
||||||
|
account: accountField.value,
|
||||||
|
ledger_index: "validated",
|
||||||
|
})
|
||||||
|
// client.disconnect()
|
||||||
|
|
||||||
|
json_results = JSON.stringify(my_acct_info, null, 2)
|
||||||
|
var parsedResults = JSON.parse(json_results)
|
||||||
|
let defRipBool = document.getElementById("defaultRipple").checked
|
||||||
|
if (defRipBool != parsedResults.result.account_flags.defaultRipple) {
|
||||||
|
if(defRipBool) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDefaultRipple)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDefaultRipple)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("allowTrustLineClawback").checked != parsedResults.result.account_flags.allowTrustLineClawback) {
|
||||||
|
if(document.getElementById("allowTrustLineClawback").checked) {
|
||||||
|
await setFlag(16)
|
||||||
|
} else {
|
||||||
|
await clearFlag(16)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("depositAuth").checked != parsedResults.result.account_flags.depositAuth) {
|
||||||
|
if(document.getElementById("depositAuth").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDepositAuth)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDepositAuth)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("disableMasterKey").checked != parsedResults.result.account_flags.disableMasterKey) {
|
||||||
|
if(document.getElementById("disableMasterKey").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDisableMaster)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDisableMaster)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("disallowIncomingCheck").checked != parsedResults.result.account_flags.disallowIncomingCheck) {
|
||||||
|
if(document.getElementById("disallowIncomingCheck").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingCheck)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingCheck)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("disallowIncomingNFTokenOffer").checked != parsedResults.result.account_flags.disallowIncomingNFTokenOffer) {
|
||||||
|
if(document.getElementById("disallowIncomingNFTokenOffer").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingNFTokenOffer)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingNFTokenOffer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("disallowIncomingPayChan").checked != parsedResults.result.account_flags.disallowIncomingPayChan) {
|
||||||
|
if(document.getElementById("disallowIncomingPayChan").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingPayChan)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingPayChan)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("disallowIncomingTrustline").checked != parsedResults.result.account_flags.disallowIncomingTrustline) {
|
||||||
|
if(document.getElementById("disallowIncomingTrustline").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingTrustline)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDisallowIncomingTrustline)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("disallowIncomingXRP").checked != parsedResults.result.account_flags.disallowIncomingXRP) {
|
||||||
|
if(document.getElementById("disallowIncomingXRP").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfDisallowXRP)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfDisallowXRP)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("globalFreeze").checked != parsedResults.result.account_flags.globalFreeze) {
|
||||||
|
if(document.getElementById("globalFreeze").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfGlobalFreeze)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfGlobalFreeze)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("noFreeze").checked != parsedResults.result.account_flags.noFreeze) {
|
||||||
|
if(document.getElementById("noFreeze").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfNoFreeze)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfNoFreeze)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("requireAuthorization").checked != parsedResults.result.account_flags.requireAuthorization) {
|
||||||
|
if(document.getElementById("requireAuthorization").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfRequireAuth)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfRequireAuth)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.getElementById("requireDestinationTag").checked != parsedResults.result.account_flags.requireDestinationTag) {
|
||||||
|
if(document.getElementById("requireDestinationTag").checked) {
|
||||||
|
await setFlag(xrpl.AccountSetAsfFlags.asfRequireDest)
|
||||||
|
} else {
|
||||||
|
await clearFlag(xrpl.AccountSetAsfFlags.asfRequireDest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!document.getElementById("is").checked) {
|
||||||
|
my_config = {
|
||||||
|
"TransactionType": "AccountSet",
|
||||||
|
"Account" : my_wallet.address,
|
||||||
|
"TickSize": 0,
|
||||||
|
"TransferRate": 1000000000,
|
||||||
|
"Domain": ""
|
||||||
|
}
|
||||||
|
const preparedAccount = await client.autofill(my_config)
|
||||||
|
const signedAccount = my_wallet.sign(preparedAccount)
|
||||||
|
const resultAccount = await client.submitAndWait(signedAccount.tx_blob)
|
||||||
|
} else {
|
||||||
|
my_config = {
|
||||||
|
"TransactionType": "AccountSet",
|
||||||
|
"Account" : my_wallet.address,
|
||||||
|
"TickSize": parseInt(document.getElementById("tickSizeField").value),
|
||||||
|
"TransferRate": parseInt(document.getElementById("transferRateField").value),
|
||||||
|
"Domain": xrpl.convertStringToHex(document.getElementById("domainField").value),
|
||||||
|
}
|
||||||
|
const preparedAccount = await client.autofill(my_config)
|
||||||
|
const signedAccount = my_wallet.sign(preparedAccount)
|
||||||
|
const resultAccount = await client.submitAndWait(signedAccount.tx_blob)
|
||||||
|
resultField.value += JSON.stringify(resultAccount, null, 2)
|
||||||
|
my_signers= {
|
||||||
|
"Flags": 0,
|
||||||
|
"TransactionType": "SignerListSet",
|
||||||
|
"Account": my_wallet.address,
|
||||||
|
"Fee": "12",
|
||||||
|
"SignerQuorum": parseInt(signerQuorumField.value),
|
||||||
|
"SignerEntries": [
|
||||||
|
{"SignerEntry":
|
||||||
|
{"Account": signer1AccountField.value,
|
||||||
|
"SignerWeight": parseInt(signer1WeightField.value)
|
||||||
|
}},
|
||||||
|
{"SignerEntry":
|
||||||
|
{"Account": signer2AccountField.value,
|
||||||
|
"SignerWeight": parseInt(signer2WeightField.value)}
|
||||||
|
},
|
||||||
|
{"SignerEntry":
|
||||||
|
{"Account": signer3AccountField.value,
|
||||||
|
"SignerWeight": parseInt(signer3WeightField.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
const preparedSigner = await client.autofill(my_signers)
|
||||||
|
const signedSigner = my_wallet.sign(preparedSigner)
|
||||||
|
const resultSigner = await client.submitAndWait(signedSigner.tx_blob)
|
||||||
|
resultField.value += JSON.stringify(resultSigner, null, 2)
|
||||||
|
}
|
||||||
|
client.disconnect()
|
||||||
|
if(!document.getElementById("is").checked) {
|
||||||
|
document.getElementById("issuer_additional_fields").style.display="none"
|
||||||
|
}
|
||||||
|
getAccountInfo()
|
||||||
|
} // End of configureAccount()
|
||||||
|
|
||||||
|
/*****************************************
|
||||||
|
************** Set Flag *****************
|
||||||
|
*****************************************/
|
||||||
|
|
||||||
|
async function setFlag(my_flag) {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
await client.connect()
|
||||||
|
let my_wallet = xrpl.Wallet.fromSeed(seedField.value)
|
||||||
|
settings_tx = {
|
||||||
|
"TransactionType": "AccountSet",
|
||||||
|
"Account": my_wallet.address,
|
||||||
|
"SetFlag": my_flag
|
||||||
|
}
|
||||||
|
resultField.value += '\nSetting flag ' + allFlags[my_flag] + "."
|
||||||
|
const prepared = await client.autofill(settings_tx)
|
||||||
|
const signed = my_wallet.sign(prepared)
|
||||||
|
const result = await client.submitAndWait(signed.tx_blob)
|
||||||
|
if (result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||||
|
resultField.value += '\nAccount setting succeeded.'
|
||||||
|
} else {
|
||||||
|
throw `Error sending transaction: ${result}`
|
||||||
|
}
|
||||||
|
client.disconnect()
|
||||||
|
} // End setFlag()
|
||||||
|
|
||||||
|
/*****************************************
|
||||||
|
************* Clear Flag *****************
|
||||||
|
*****************************************/
|
||||||
|
|
||||||
|
async function clearFlag(my_flag) {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
await client.connect()
|
||||||
|
let my_wallet = xrpl.Wallet.fromSeed(seedField.value)
|
||||||
|
settings_tx = {
|
||||||
|
"TransactionType": "AccountSet",
|
||||||
|
"Account": my_wallet.address,
|
||||||
|
"ClearFlag": my_flag
|
||||||
|
}
|
||||||
|
resultField.value += '\nClearing flag ' + allFlags[my_flag] + "."
|
||||||
|
const prepared = await client.autofill(settings_tx)
|
||||||
|
const signed = my_wallet.sign(prepared)
|
||||||
|
const result = await client.submitAndWait(signed.tx_blob)
|
||||||
|
if (result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||||
|
results += '\nAccount setting succeeded.'
|
||||||
|
} else {
|
||||||
|
throw `Error sending transaction: ${result}`
|
||||||
|
}
|
||||||
|
client.disconnect()
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************
|
||||||
|
************* Set Issuer *****************
|
||||||
|
*****************************************/
|
||||||
|
|
||||||
|
function setIssuer() {
|
||||||
|
document.getElementById("defaultRipple").checked = true
|
||||||
|
document.getElementById("allowTrustLineClawback").checked = false
|
||||||
|
document.getElementById("depositAuth").checked = true
|
||||||
|
document.getElementById("disableMasterKey").checked = false
|
||||||
|
document.getElementById("disallowIncomingCheck").checked = true
|
||||||
|
document.getElementById("disallowIncomingNFTokenOffer").checked = true
|
||||||
|
document.getElementById("disallowIncomingPayChan").checked = true
|
||||||
|
document.getElementById("disallowIncomingTrustline").checked = false
|
||||||
|
document.getElementById("disallowIncomingXRP").checked = true
|
||||||
|
document.getElementById("globalFreeze").checked = false
|
||||||
|
document.getElementById("noFreeze").checked = false
|
||||||
|
document.getElementById("requireAuthorization").checked = false
|
||||||
|
document.getElementById("requireDestinationTag").checked = false
|
||||||
|
document.getElementById("account_flags").style.display="block"
|
||||||
|
document.getElementById("issuer_additional_fields").style.display="block"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************
|
||||||
|
*********** Set Exchanger ****************
|
||||||
|
*****************************************/
|
||||||
|
|
||||||
|
function setExchanger() {
|
||||||
|
document.getElementById("defaultRipple").checked = true
|
||||||
|
document.getElementById("allowTrustLineClawback").checked = false
|
||||||
|
document.getElementById("depositAuth").checked = false
|
||||||
|
document.getElementById("disableMasterKey").checked = false
|
||||||
|
document.getElementById("disallowIncomingCheck").checked = false
|
||||||
|
document.getElementById("disallowIncomingNFTokenOffer").checked = true
|
||||||
|
document.getElementById("disallowIncomingPayChan").checked = true
|
||||||
|
document.getElementById("disallowIncomingTrustline").checked = false
|
||||||
|
document.getElementById("disallowIncomingXRP").checked = false
|
||||||
|
document.getElementById("globalFreeze").checked = false
|
||||||
|
document.getElementById("noFreeze").checked = false
|
||||||
|
document.getElementById("requireAuthorization").checked = false
|
||||||
|
document.getElementById("requireDestinationTag").checked = true
|
||||||
|
document.getElementById("account_flags").style.display="block"
|
||||||
|
document.getElementById("issuer_additional_fields").style.display="none"
|
||||||
|
document.getElementById("domainField").value = ""
|
||||||
|
document.getElementById("transferRateField").value = ""
|
||||||
|
document.getElementById("tickSizeField").value = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************
|
||||||
|
************* Set Holder *****************
|
||||||
|
*****************************************/
|
||||||
|
|
||||||
|
function setHolder()
|
||||||
|
{
|
||||||
|
document.getElementById("defaultRipple").checked = false
|
||||||
|
document.getElementById("allowTrustLineClawback").checked = false
|
||||||
|
document.getElementById("depositAuth").checked = false
|
||||||
|
document.getElementById("disableMasterKey").checked = false
|
||||||
|
document.getElementById("disallowIncomingCheck").checked = false
|
||||||
|
document.getElementById("disallowIncomingNFTokenOffer").checked = false
|
||||||
|
document.getElementById("disallowIncomingPayChan").checked = false
|
||||||
|
document.getElementById("disallowIncomingTrustline").checked = false
|
||||||
|
document.getElementById("disallowIncomingXRP").checked = false
|
||||||
|
document.getElementById("globalFreeze").checked = false
|
||||||
|
document.getElementById("noFreeze").checked = false
|
||||||
|
document.getElementById("requireAuthorization").checked = false
|
||||||
|
document.getElementById("requireDestinationTag").checked = false
|
||||||
|
document.getElementById("domainField").value = ""
|
||||||
|
document.getElementById("transferRateField").value = ""
|
||||||
|
document.getElementById("tickSizeField").value = ""
|
||||||
|
document.getElementById("issuer_additional_fields").style.display="none"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************
|
||||||
|
************* Remove Signers *************
|
||||||
|
*****************************************/
|
||||||
|
|
||||||
|
async function removeSigners() {
|
||||||
|
let net = getNet()
|
||||||
|
const client = new xrpl.Client(net)
|
||||||
|
resultField.value = `Connecting to ${net}.`
|
||||||
|
await client.connect()
|
||||||
|
my_wallet = xrpl.Wallet.fromSeed(seedField.value)
|
||||||
|
|
||||||
|
signer1AccountField.value = ""
|
||||||
|
signer2AccountField.value = ""
|
||||||
|
signer3AccountField.value = ""
|
||||||
|
signer1WeightField.value = ""
|
||||||
|
signer2WeightField.value= ""
|
||||||
|
signer3WeightField.value = ""
|
||||||
|
signerQuorumField.value = ""
|
||||||
|
my_signers= {
|
||||||
|
"Flags": 0,
|
||||||
|
"TransactionType": "SignerListSet",
|
||||||
|
"Account": my_wallet.address,
|
||||||
|
"Fee": "12",
|
||||||
|
"SignerQuorum": 0
|
||||||
|
}
|
||||||
|
const preparedSigner = await client.autofill(my_signers)
|
||||||
|
const signedSigner = my_wallet.sign(preparedSigner)
|
||||||
|
const resultSigner = await client.submitAndWait(signedSigner.tx_blob)
|
||||||
|
resultField.value += JSON.stringify(resultSigner, null, 2)
|
||||||
|
client.disconnect()
|
||||||
|
}
|
||||||
BIN
_code-samples/account-configurator/account-configurator.zip
Normal file
BIN
_code-samples/account-configurator/account-configurator.zip
Normal file
Binary file not shown.
188
docs/concepts/accounts/configuring-accounts.md
Normal file
188
docs/concepts/accounts/configuring-accounts.md
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
---
|
||||||
|
seo:
|
||||||
|
description: Common configurations for an XRP Ledger account.
|
||||||
|
labels:
|
||||||
|
- Accounts
|
||||||
|
- Configuration
|
||||||
|
---
|
||||||
|
# Configuring Accounts
|
||||||
|
|
||||||
|
There are three basic account configurations on the XRP Ledger.
|
||||||
|
|
||||||
|
- [Holder](#holder)
|
||||||
|
- [Exchanger](#exchanger)
|
||||||
|
- [Issuer](#issuer)
|
||||||
|
|
||||||
|
Each of these accounts has different operational and security requirements for their function. You can start by configuring special behaviors that support the use case for each.
|
||||||
|
|
||||||
|
You can use the [Account Configurator](#using-the-account-configurator) to create new accounts on Testnet or Devnet and try out different permissions and configurations. You can also get information about accounts on Mainnet and see their real time settings.
|
||||||
|
|
||||||
|
## Holder
|
||||||
|
|
||||||
|
To configure an account that is essentially going to hold and spend value on the XRPL, you can use the default settings that come with a new account. No special configuration is required.
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator1.png)
|
||||||
|
|
||||||
|
## Exchanger
|
||||||
|
|
||||||
|
If the primary purpose of an account is to facilitate exchange of value between third parties, you will likely start with these four settings:
|
||||||
|
|
||||||
|
| Flag | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| `defaultRipple` | Allow rippling on trust lines by default. Rippling is necessary in order for accounts to trade tokens you exchange with third-party accounts. See [Rippling](../../tokens/fungible-tokens/rippling). |
|
||||||
|
| `disallowIncomingNFTokenOffer` | Prevent other accounts from sending NFT buy or sell offers to this account. This avoids unsolicited offers unrelated to the primary purpose of the exchanger account. See [Trading NFTs](../../tokens/nfts/trading). |
|
||||||
|
| `disallowIncomingPayChan` | Prevent other accounts from creating payment channels to this account. While you might want to create payment channels to other accounts yourself, you typically wouldn't want other accounts to create a payment channel to an exchange account. See [Payment Channels](../../payment-types/payment-channels). |
|
||||||
|
| `requireDestinationTag` | Require that all incoming payments have a destination tag. Destination tags provide a more lightweight mechanism for sending payments to a specific customer at a general receiver account. See [Source and Destination Tags](../../transactions/source-and-destination-tags). |
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator2.png)
|
||||||
|
|
||||||
|
## Issuer
|
||||||
|
|
||||||
|
An account intended for issuing tokens requires configuration of both fields and flags in the `Account` object.
|
||||||
|
|
||||||
|
### Issuer Fields
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| `Domain` | The domain is the URL to the server where you serve the xrp-ledger.toml file. It is recommended that you serve a human-readable website from the same domain as the xrp-ledger.toml file. The website can provide further information about your identity and how you use the XRP Ledger, which helps to build trust toward you and your services. See [Domain](../../references/xrp-ledger-toml/). |
|
||||||
|
| `TransferRate` | The `TransferRate` value specifies a fee to charge whenever counterparties transfer the currency you issue. The value is sent in 1 billion units. For example, 1200000000 represents a transfer fee of 20%. Note that the values _0_ and _1000000000_ represent the default (no fee); if you explicitly set either value, the value is not stored, but assumed. See [Transfer Fees](../tokens/transfer-fees/). |
|
||||||
|
| `TickSize` | The `TickSize` value truncates the number of significant digits in the exchange rate of an offer when it gets placed in an order book. See [TickSize](../tokens/decentralized-exchange/ticksize/). |
|
||||||
|
|
||||||
|
### Signers
|
||||||
|
|
||||||
|
Multi-signing in the XRP Ledger is a method of authorizing transactions by using a combination of multiple secret keys. You create a list of signer accounts. Each signer has a weight, representing the relative authority of that signer account. The signer quorum represents the minimum weight total required to authorize a transaction. For example, if Ashad and Betty each have a signer weight of 1, Ceresia has a signer weight of 2, and the signer quorum is 3, Ashad and Ceresia can approve a transaction (weight total of 3), Betty and Ceresia can approve a transaction (weight total of 3), but Ashad and Betty cannot approve a transaction on their own (their combined signer weight is 2, 1 less than the required signer weight). See [Multi-Signing](./multi-signing).
|
||||||
|
|
||||||
|
### Issuer Flags
|
||||||
|
|
||||||
|
| Flag | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| `defaultRipple` | Allow rippling on trust lines by default. Rippling is necessary in order for accounts to trade tokens you issue through this account. See [Rippling](../../tokens/fungible-tokens/rippling). |
|
||||||
|
| `depositAuth` | Deposit Authorization prevents unauthorized third parties from sending you payments. See [Deposit Authorization](./depositauth).
|
||||||
|
| `disallowIncomingCheck` | Prevent other accounts from sending checks to this account. See [Checks](../payment-types/checks/).
|
||||||
|
| `disallowIncomingNFTokenOffer` | Prevent other accounts from sending NFT buy or sell offers to this account. This avoids unsolicited offers unrelated to the primary purpose of the exchanger account. See [Trading NFTs](../../tokens/nfts/trading). |
|
||||||
|
| `disallowIncomingPayChan` | Prevent other accounts from creating payment channels to this account. While you might want to create payment channels to other accounts yourself, you typically wouldn't want other accounts to create a payment channel to an exchange account. See [Payment Channels](../../payment-types/payment-channels). |
|
||||||
|
| `disallowIncomingXRP` | Prevent other accounts from sending XRP to this account. (This is advisory, and not enforced by the protocol). See [Direct XRP Payments](../payment-types/direct-xrp-payments/). |
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator3.png)
|
||||||
|
|
||||||
|
## Other Configuration Flags
|
||||||
|
|
||||||
|
All of the configuration flags can be helpful for specific use cases. The following are the account configuration flags not used in the standard Holder, Exchanger, and Issuer configurations.
|
||||||
|
|
||||||
|
| Flag | Description |
|
||||||
|
|------|-------------|
|
||||||
|
| `allowTrustLineClawback` | Allow account to claw back tokens it has issued. See [Clawing Back Tokens](../../tokens/fungible-tokens/clawing-back-tokens). |
|
||||||
|
| `disableMasterKey` | Disallow use of the master key pair. Can only be enabled if the account has configured another way to sign transactions, such as a regular key or a signer list. See [Master Key Pair](./cryptographic-keys#master-key-pair). |
|
||||||
|
| `disallowIncomingTrustLine` | Block incoming trust lines. See [Trust Lines](../tokens/fungible-tokens#trust-lines). |
|
||||||
|
| `globalFreeze` | Freeze all tokens issued by this account. See [Global Freeze](../tokens/fungible-tokens/freezes#global-freeze).
|
||||||
|
| `noFreeze` | Permanently remove the ability to freeze individual trust lines or end a global freeze. See [Freezing Tokens](../tokens/fungible-tokens/freezes). |
|
||||||
|
| `requireAuthorization` | Requires authorized trust lines for other accounts to hold tokens issued by this account. See [Authorized Trust Lines](../tokens/fungible-tokens/authorized-trust-lines).
|
||||||
|
|
||||||
|
|
||||||
|
## Using the Account Configurator
|
||||||
|
|
||||||
|
You can download a copy of the [Account Configurator](../../../_code-samples/account-configurator/account-configurator.zip) from the `_code_samples` directory.
|
||||||
|
|
||||||
|
Expand the archive and open `account_configurator.html` in a browser window.
|
||||||
|
|
||||||
|
### Getting Account Information
|
||||||
|
|
||||||
|
You can use the Account Configurator to view information about accounts on Mainnet, Testnet, and Devnet.
|
||||||
|
|
||||||
|
#### To get Account information
|
||||||
|
|
||||||
|
1. Choose the account's ledger instance (_Mainnet_, _Testnet_ or _Devnet_).
|
||||||
|
2. Enter the account number in the **Account** field.
|
||||||
|
3. Click **Get Account Info**.
|
||||||
|
|
||||||
|
The response is displayed in the **Results** field.
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator6.png)
|
||||||
|
|
||||||
|
### Getting a New Account
|
||||||
|
|
||||||
|
You can create sandbox accounts on _Testnet_ or _Devnet_. To create an account on _Mainnet_, see [Creating Accounts](../accounts#creating-accounts).
|
||||||
|
|
||||||
|
#### To get a new Account
|
||||||
|
|
||||||
|
1. Choose the account's ledger instance (_Testnet_ or _Devnet_).
|
||||||
|
2. Click **Get New Account**.
|
||||||
|
|
||||||
|
Be sure to capture the **Seed** value for your new account so that you can easily retrieve it.
|
||||||
|
|
||||||
|
### Getting an Account from Its Seed
|
||||||
|
|
||||||
|
You can reload information for an existing account based on its seed value.
|
||||||
|
|
||||||
|
#### To get an account from its seed
|
||||||
|
|
||||||
|
1. Choose the account's ledger instance (_Testnet_ or _Devnet_).
|
||||||
|
2. Enter the value in the **Seed** field.
|
||||||
|
3. Click **Get Account From Seed**.
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator1.png)
|
||||||
|
|
||||||
|
### Configuring a Holder Account
|
||||||
|
|
||||||
|
A Holder account requires no configuration (default settings). If the account previously had configuration changes, you can revert them and return the account to default status.
|
||||||
|
|
||||||
|
#### To configure a Holder account
|
||||||
|
|
||||||
|
1. Choose the account's ledger instance (_Testnet_ or _Devnet_).
|
||||||
|
2. Click **Get New Account**
|
||||||
|
OR
|
||||||
|
1. Enter the value in the **Seed** field.
|
||||||
|
2. Click **Get Account From Seed**.
|
||||||
|
3. Choose the _Holder_ **Account Configuration Template**.
|
||||||
|
4. Click **Configure Account**.
|
||||||
|
|
||||||
|
If the account has never been configured, the response in the **Results** field is identical to the original account information, less the nominal transaction fee.
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator1.png)
|
||||||
|
|
||||||
|
### Configuring an Exchanger Account
|
||||||
|
|
||||||
|
The standard Exchanger account configuration requires only four flags.
|
||||||
|
|
||||||
|
#### To configure an Exchanger account
|
||||||
|
|
||||||
|
1. Choose the account's ledger instance (_Testnet_ or _Devnet_).
|
||||||
|
2. Click **Get New Account**.
|
||||||
|
OR
|
||||||
|
1. Enter a value in the **Seed** field.
|
||||||
|
2. Click **Get Account From Seed**.
|
||||||
|
3. Choose the _Exchanger_ **Account Configuration Template**.
|
||||||
|
The configuration flag checkboxes update with the 4 standard configuration choices. You can choose more or fewer configuration settings to customize the account to your needs.
|
||||||
|
4. Click **Configure Account**.
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator4.png)
|
||||||
|
|
||||||
|
### Configuring an Issuer Account
|
||||||
|
|
||||||
|
Configure an Issuer account by filling in additional fields and selecting flags that serve your needs.
|
||||||
|
|
||||||
|
#### To configure an Issuer account
|
||||||
|
|
||||||
|
1. Choose the account's ledger instance (_Testnet_ or _Devnet_).
|
||||||
|
2. Click **Get New Account**.
|
||||||
|
OR
|
||||||
|
1. Enter a value in the **Seed** field.
|
||||||
|
2. Click **Get Account From Seed**.
|
||||||
|
3. Choose the _Issuer_ **Account Configuration Template**.
|
||||||
|
The configuration flag checkboxes update with the 6 standard configuration choices. You can choose more or fewer
|
||||||
|
configuration settings to customize the account to your needs.
|
||||||
|
4. Enter the **Domain**, a URL to the server where your `xrp-ledger.toml` resides. Note that you enter a human readable URL, which is converted to a hexidecimal string when you get the account information. If you want to reconfigure the account, you'll need to re-enter the **Domain** URL.
|
||||||
|
5. Enter the **Transfer Rate**, a percentage fee to charge whenever counterparties transfer the currency you issue.
|
||||||
|
6. Enter the **Tick Size**, which truncates the number of significant digits in the exchange.
|
||||||
|
7. If you choose to include signers, this example module requires that you add valid account IDs in **Signer1 Account**, **Signer2 Account**, and **Signer3 Account**, a **Signer Weight** for each, and a **Signer Quorum** value.
|
||||||
|
8. Click **Configure Account**.
|
||||||
|
|
||||||
|
{% admonition type="success" name="Note" %}Admitting to laziness on the author's part (and avoiding scope creep), setting Signers for an account requires changing all of them in a single transaction. The additional programming required to allow for an indeterminate number of signers and updates to individual signer weights is not essential to understanding account configuration. The sample code is easy to manipulate if you want your own example to add more or fewer than 3 signers.{% /admonition %}
|
||||||
|
|
||||||
|
[](../../img/cpt-account-configurator5.png)
|
||||||
|
|
||||||
|
### Removing Signers
|
||||||
|
|
||||||
|
Click **Remove Signers** to remove all signers for the current account.
|
||||||
|
|
||||||
|
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||||
BIN
docs/img/cpt-account-configurator1.png
Normal file
BIN
docs/img/cpt-account-configurator1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 446 KiB |
BIN
docs/img/cpt-account-configurator2.png
Normal file
BIN
docs/img/cpt-account-configurator2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 477 KiB |
BIN
docs/img/cpt-account-configurator3.png
Normal file
BIN
docs/img/cpt-account-configurator3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 497 KiB |
BIN
docs/img/cpt-account-configurator4.png
Normal file
BIN
docs/img/cpt-account-configurator4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 414 KiB |
BIN
docs/img/cpt-account-configurator5.png
Normal file
BIN
docs/img/cpt-account-configurator5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
BIN
docs/img/cpt-account-configurator6.png
Normal file
BIN
docs/img/cpt-account-configurator6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 456 KiB |
@@ -146,6 +146,7 @@
|
|||||||
expanded: false
|
expanded: false
|
||||||
items:
|
items:
|
||||||
- page: docs/concepts/accounts/account-types.md
|
- page: docs/concepts/accounts/account-types.md
|
||||||
|
- page: docs/concepts/accounts/configuring-accounts.md
|
||||||
- page: docs/concepts/accounts/deleting-accounts.md
|
- page: docs/concepts/accounts/deleting-accounts.md
|
||||||
- page: docs/concepts/accounts/reserves.md
|
- page: docs/concepts/accounts/reserves.md
|
||||||
- page: docs/concepts/accounts/addresses.md
|
- page: docs/concepts/accounts/addresses.md
|
||||||
|
|||||||
Reference in New Issue
Block a user