mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-07 21:35:49 +00:00
Fix AccountRootFlag import to avoid require
This commit is contained in:
@@ -18,11 +18,12 @@ async function main() {
|
|||||||
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
|
||||||
|
const lsfGlobalFreeze = xrpl.LedgerEntry.AccountRootFlags.lsfGlobalFreeze
|
||||||
|
|
||||||
console.log('Got settings for address', my_address);
|
console.log('Got settings for address', my_address);
|
||||||
console.log('Global Freeze enabled?',
|
console.log('Global Freeze enabled?',
|
||||||
((settings.account_data.Flags & AccountRootFlags.lsfGlobalFreeze)
|
((settings.account_data.Flags & lsfGlobalFreeze)
|
||||||
=== AccountRootFlags.lsfGlobalFreeze))
|
=== lsfGlobalFreeze))
|
||||||
|
|
||||||
await client.disconnect()
|
await client.disconnect()
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
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')
|
||||||
var { AccountRootFlags } = require('xrpl/dist/npm/models/ledger');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -19,11 +18,12 @@ async function main() {
|
|||||||
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
|
||||||
|
const lsfNoFreeze = xrpl.LedgerEntry.AccountRootFlags.lsfNoFreeze
|
||||||
|
|
||||||
console.log('Got settings for address', my_address);
|
console.log('Got settings for address', my_address);
|
||||||
console.log('No Freeze enabled?',
|
console.log('No Freeze enabled?',
|
||||||
(settings.account_data.Flags & AccountRootFlags.lsfNoFreeze)
|
(settings.account_data.Flags & lsfNoFreeze)
|
||||||
=== AccountRootFlags.lsfNoFreeze)
|
=== lsfNoFreeze)
|
||||||
|
|
||||||
await client.disconnect()
|
await client.disconnect()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user