mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
Fix indentation
This commit is contained in:
@@ -1,36 +1,36 @@
|
|||||||
// Dependencies for Node.js.
|
// Dependencies for Node.js.
|
||||||
// In browsers, use <script> tags as in the example demo.html.
|
// In browsers, use <script> tags as in the example demo.html.
|
||||||
if (typeof module !== "undefined") {
|
if (typeof module !== "undefined") {
|
||||||
// gotta use var here because const/let are block-scoped to the if statement.
|
// gotta use var here because const/let are block-scoped to the if statement.
|
||||||
var xrpl = require('xrpl')
|
var xrpl = require('xrpl')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect -------------------------------------------------------------------
|
// Connect -------------------------------------------------------------------
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log("Connecting to Mainnet...")
|
console.log("Connecting to Mainnet...")
|
||||||
const client = new xrpl.Client('wss://s1.ripple.com')
|
const client = new xrpl.Client('wss://s1.ripple.com')
|
||||||
await client.connect()
|
await client.connect()
|
||||||
|
|
||||||
client.on('error', (errorCode, errorMessage) => {
|
|
||||||
console.log(errorCode + ': ' + errorMessage)
|
|
||||||
})
|
|
||||||
|
|
||||||
const my_address = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
|
|
||||||
|
|
||||||
// Request account info for my_address to check account settings ------------
|
|
||||||
const response = await client.request(
|
|
||||||
{command: 'account_info', account: my_address })
|
|
||||||
const settings = response.result
|
|
||||||
const lsfGlobalFreeze = 0x00400000
|
|
||||||
|
|
||||||
console.log('Got settings for address', my_address);
|
client.on('error', (errorCode, errorMessage) => {
|
||||||
console.log('Global Freeze enabled?',
|
console.log(errorCode + ': ' + errorMessage)
|
||||||
((settings.account_data.Flags & lsfGlobalFreeze) === lsfGlobalFreeze))
|
})
|
||||||
|
|
||||||
await client.disconnect()
|
const my_address = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
|
||||||
|
|
||||||
// End main()
|
// Request account info for my_address to check account settings ------------
|
||||||
}
|
const response = await client.request(
|
||||||
|
{command: 'account_info', account: my_address })
|
||||||
main().catch(console.error)
|
const settings = response.result
|
||||||
|
const lsfGlobalFreeze = 0x00400000
|
||||||
|
|
||||||
|
console.log('Got settings for address', my_address);
|
||||||
|
console.log('Global Freeze enabled?',
|
||||||
|
((settings.account_data.Flags & lsfGlobalFreeze) === lsfGlobalFreeze))
|
||||||
|
|
||||||
|
await client.disconnect()
|
||||||
|
|
||||||
|
// End main()
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch(console.error)
|
||||||
|
|
||||||
@@ -1,33 +1,33 @@
|
|||||||
// Dependencies for Node.js.
|
// Dependencies for Node.js.
|
||||||
// In browsers, use <script> tags as in the example demo.html.
|
// In browsers, use <script> tags as in the example demo.html.
|
||||||
if (typeof module !== "undefined") {
|
if (typeof module !== "undefined") {
|
||||||
// gotta use var here because const/let are block-scoped to the if statement.
|
// gotta use var here because const/let are block-scoped to the if statement.
|
||||||
var xrpl = require('xrpl')
|
var xrpl = require('xrpl')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect -------------------------------------------------------------------
|
// Connect -------------------------------------------------------------------
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log("Connecting to Mainnet...")
|
console.log("Connecting to Mainnet...")
|
||||||
const client = new xrpl.Client('wss://s1.ripple.com')
|
const client = new xrpl.Client('wss://s1.ripple.com')
|
||||||
await client.connect()
|
await client.connect()
|
||||||
|
|
||||||
client.on('error', (errorCode, errorMessage) => {
|
client.on('error', (errorCode, errorMessage) => {
|
||||||
console.log(errorCode + ': ' + errorMessage)
|
console.log(errorCode + ': ' + errorMessage)
|
||||||
})
|
})
|
||||||
|
|
||||||
const my_address = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
|
const my_address = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
|
||||||
|
|
||||||
// Request account info for my_address to check account settings ------------
|
// Request account info for my_address to check account settings ------------
|
||||||
const response = await client.request(
|
const response = await client.request(
|
||||||
{command: 'account_info', account: my_address })
|
{command: 'account_info', account: my_address })
|
||||||
const settings = response.result
|
const settings = response.result
|
||||||
|
|
||||||
console.log('Got settings for address', my_address);
|
console.log('Got settings for address', my_address);
|
||||||
console.log('No Freeze enabled?', (settings.noFreeze === true))
|
console.log('No Freeze enabled?', (settings.noFreeze === true))
|
||||||
|
|
||||||
await client.disconnect()
|
await client.disconnect()
|
||||||
|
|
||||||
// End main()
|
// End main()
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch(console.error)
|
main().catch(console.error)
|
||||||
|
|||||||
Reference in New Issue
Block a user