mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +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(
|
||||
{command: 'account_info', account: my_address })
|
||||
const settings = response.result
|
||||
const lsfGlobalFreeze = xrpl.LedgerEntry.AccountRootFlags.lsfGlobalFreeze
|
||||
|
||||
console.log('Got settings for address', my_address);
|
||||
console.log('Global Freeze enabled?',
|
||||
((settings.account_data.Flags & AccountRootFlags.lsfGlobalFreeze)
|
||||
=== AccountRootFlags.lsfGlobalFreeze))
|
||||
((settings.account_data.Flags & lsfGlobalFreeze)
|
||||
=== lsfGlobalFreeze))
|
||||
|
||||
await client.disconnect()
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
if (typeof module !== "undefined") {
|
||||
// gotta use var here because const/let are block-scoped to the if statement.
|
||||
var xrpl = require('xrpl')
|
||||
var { AccountRootFlags } = require('xrpl/dist/npm/models/ledger');
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +18,12 @@ async function main() {
|
||||
const response = await client.request(
|
||||
{command: 'account_info', account: my_address })
|
||||
const settings = response.result
|
||||
const lsfNoFreeze = xrpl.LedgerEntry.AccountRootFlags.lsfNoFreeze
|
||||
|
||||
console.log('Got settings for address', my_address);
|
||||
console.log('No Freeze enabled?',
|
||||
(settings.account_data.Flags & AccountRootFlags.lsfNoFreeze)
|
||||
=== AccountRootFlags.lsfNoFreeze)
|
||||
(settings.account_data.Flags & lsfNoFreeze)
|
||||
=== lsfNoFreeze)
|
||||
|
||||
await client.disconnect()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user