Fix AccountRootFlag import to avoid require

This commit is contained in:
Jackson Mills
2021-10-22 15:14:23 -07:00
parent ab6fd81297
commit fc6ed9b850
2 changed files with 6 additions and 5 deletions

View File

@@ -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()

View File

@@ -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()