Skip to content

Documentation

Cale Robertson edited this page Sep 20, 2019 · 22 revisions

Below you will find a full list of implemented methods/functions, including their purpose and any default values.

XRPowerShell is made of a single PowerShell module (.psm1 file) containing multiple functions, as well as a few global variables, such as the webSocket id.


Function list

Connection functions

Server functions

Account functions

Ledger functions

Transaction functions

Utility functions


Functions

Connect-XRPL

The Connect-XRPL function creates a websocket connection to a public rippled server.

  • [string] SocketURL | The secure websocket address used to as the destination for the websocket connection. Note: this is a positional parameter and can be entered directly after the function call.
Connect-XRPL "wss://s1.ripple.com:443"

Disconnect-XRPL

The Disconnect-XRPL function closes the active websocket connection to a public rippled server.

Disconnect-XRPL

Get-ServerInfo

The Get-ServerInfo command asks the server for a human-readable version of various information about the rippled server being queried.

  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-ServerInfo -ToString

Get-ServerState

The Get-ServerState command asks the server for various machine-readable information about the rippled server's current state. The response is almost the same as the server_info method, but uses units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.)

  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-ServerState -ToString

Get-Fee

The Get-Fee command reports the current state of the open-ledger requirements for the transaction cost. This requires the FeeEscalation amendment to be enabled.

  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-Fee

Ping-Server

The Ping-Server command returns an acknowledgement, so that clients can test the connection status and latency.

  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Ping-Server

Get-AccountChannels

The Get-AccountChannels method returns information about an account's Payment Channels. This includes only channels where the specified account is the channel's source, not the destination. (A channel's "source" and "owner" are the same.) All information retrieved is relative to a particular version of the ledger.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Destination | (optional) The unique identifier of an account, typically the account's Address. If provided, filter results to payment channels whose destination is this account.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [string] Marker | (optional) Value from a previous paginated response. Resume retrieving data where that response left off.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountChannels "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -Limit 20 -ToString

Get-AccountCurrencies

The Get-AccountCurrencies command retrieves a list of currencies that an account can send or receive, based on its trust lines. (This is not a thoroughly confirmed list, but it can be used to populate user interfaces.)

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [switch] Strict | (optional) If true, only accept an address or public key for the account parameter. Defaults to false.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountCurrencies "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -Strict

Get-AccountInfo

The Get-AccountCurrencies command retrieves a list of currencies that an account can send or receive, based on its trust lines. (This is not a thoroughly confirmed list, but it can be used to populate user interfaces.)

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [switch] Queue | (optional) If true, and the FeeEscalation amendment is enabled, also returns stats about queued transactions associated with this account. Can only be used when querying for the data from the current open ledger.
  • [switch] SignerLists | (optional) If true, and the MultiSign amendment is enabled, also returns any SignerList objects associated with this account.
  • [switch] Strict | (optional) If true, only accept an address or public key for the account parameter. Defaults to false.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountInfo "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE"

Get-AccountLines

The Get-AccountLines method returns information about an account's trust lines, including balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [string] Peer | (optional) The Address of a second account. If provided, show only lines of trust connecting the two accounts.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [string] Marker | (optional) Value from a previous paginated response. Resume retrieving data where that response left off.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountLines "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -Peer "rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN" -Limit 15

Get-AccountObjects

The Get-AccountObjects command returns the raw ledger format for all objects owned by an account. For a higher-level view of an account's trust lines and balances, see the Get-AccountLines method instead.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [AccountObjectTypes] Type | (optional) If included, filter results to include only this type of ledger object. The valid types are: Check, DepositPreath, Escrow, Offer, PaymentChannel, SignerList, and State (trust line).
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [string] Peer | (optional) The Address of a second account. If provided, show only lines of trust connecting the two accounts.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [string] Marker | (optional) Value from a previous paginated response. Resume retrieving data where that response left off.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountObjects "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -Type Escrow

Get-AccountOffers

The Get-AccountOffers method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountOffers "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -Limit 15

Get-AccountTx

The Get-AccountTx method retrieves a list of transactions that involved the specified account.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [string] Marker | (optional) Value from a previous paginated response. Resume retrieving data where that response left off.
  • [Int32] LedgerMax | (optional) Use to specify the most recent ledger to include transactions from. A value of -1 instructs the server to use the most recent validated ledger version available.
  • [Int32] LedgerMin | (optional) Use to specify the earliest ledger to include transactions from. A value of -1 instructs the server to use the earliest validated ledger version available.
  • [switch] Binary | (optional) Defaults to false. If set to true, returns transactions as hex strings instead of JSON.
  • [switch] Forward | (optional) Defaults to false. If set to true, returns values indexed with the oldest ledger first. Otherwise, the results are indexed with the newest ledger first. (Each page of results may not be internally ordered, but the pages are overall ordered.)
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-AccountTx "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -LedgerMin 47227450 -LedgerMax 47469994

Get-GatewayBalances

The Get-GatewayBalances command calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [string] / [array] HotWallet | (optional) An operational address to exclude from the balances issued, or an array of such addresses.
  • [switch] Strict | (optional) If true, only accept an address or public key for the account parameter. Defaults to false.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-GatewayBalances "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -LedgerIndex "validated" -HotWallet "rK6g2UYc4GpQH8DYdPG7wywyQbxkJpQTTN"

Get-NoRippleCheck

The Get-NoRippleCheck command provides a quick way to check the status of the DefaultRipple field for an account and the NoRipple flag of its trust lines, compared with the recommended settings.

  • [string] Address | The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. This is a positional parameter.
  • [string] Role | Whether the address refers to a 'gateway' or 'user'. Recommendations depend on the role of the account. Issuers must have DefaultRipple enabled and must disable NoRipple on all trust lines. Users should have DefaultRipple disabled, and should enable NoRipple on all trust lines.
  • [switch] Transactions | (optional) If true, include an array of suggested transactions, as JSON objects, that you can sign and submit to fix the problems. Defaults to false.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-NoRippleCheck "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE" -Role "user"

Get-Ledger

Retrieve information about the public ledger.

  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [switch] Transactions | (optional) If true, return information on transactions in the specified ledger version. Defaults to false. Ignored if you did not specify a ledger version.
  • [switch] Expand | (optional) Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to false. Ignored unless you request transactions, accounts, or both.
  • [switch] Binary | (optional) If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.
  • [switch] Queue | (optional) If true, and the command is requesting the current ledger, includes an array of queued transactions in the results.
  • [switch] OwnerFunds | (optional) If true, include owner_funds field in the metadata of OfferCreate transactions in the response. Defaults to false. Ignored unless transactions are included and expand is true.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-Ledger -Hash "B0A671FD11208EDBBE390A146C69F6D7DDFFFAF2589DBF6310BD5F795C43BA15" -ToString

Get-LedgerClosed

The Get-LedgerClosed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)

  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-LedgerClosed -ToString

Get-LedgerCurrent

The Get-LedgerCurrent method returns the unique identifiers of the current in-progress ledger. This command is mostly useful for testing, because the ledger returned is still in flux.

  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-LedgerCurrent -ToString

Get-LedgerData

The Get-LedgerData method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version.

  • [string] Hash | (optional) A 20-byte hex string for the ledger version to use.
  • [string] / [Int32] LedgerIndex | (optional) The sequence number of the ledger to use, or a shortcut string to choose a ledger automatically.
  • [switch] Binary | (optional) If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.
  • [Int32] Limit | (optional) Limit the number of transactions to retrieve. The server is not required to honor this value. Must be within the inclusive range 10 to 400. Defaults to 10.
  • [string] Marker | (optional) Value from a previous paginated response. Resume retrieving data where that response left off.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-LedgerData -Hash "B0A671FD11208EDBBE390A146C69F6D7DDFFFAF2589DBF6310BD5F795C43BA15"

Get-LedgerEntry

Not yet implemented.


Get-Transaction

The Get-Transaction method retrieves information on a single transaction.

  • [string] Transaction | Transaction in JSON format with an array of Signers. To be successful, the weights of the signatures must be equal or higher than the quorum of the SignerList. This is a positional parameter and can be input directly after the function call in position 0.
  • [switch] Binary | (optional) If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Get-Transaction "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7" -ToString

Submit-Transaction

The Submit-Transaction method applies a transaction and sends it to the network to be confirmed and included in future ledgers. Takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission.

  • [string] TxBlob | Hex representation of the signed transaction to submit.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
Submit-Transaction -TxBlob "1200002280000000240000001E61D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000B732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210095D23D8AF107DF50651F266259CC7139D0CD0C64ABBA3A958156352A0D95A21E02207FCF9B77D7510380E49FF250C21B57169E14E9B4ACFD314CEDC79DDD0A38B8A681144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754" -ToString

Submit-MultiSigned

The Submit-MultiSigned command applies a multi-signed transaction and sends it to the network to be included in future ledgers. (You can also submit multi-signed transactions in binary form using the submit command in submit-only mode.)

  • [string] TxJSON | Transaction in JSON format with an array of Signers. To be successful, the weights of the signatures must be equal or higher than the quorum of the SignerList.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
$myMultiTx = 
'{
        "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
        "Fee": "30000",
        "Flags": 262144,
        "LimitAmount": {
            "currency": "USD",
            "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
            "value": "100"
        },
        "Sequence": 2,
        "Signers": [{
            "Signer": {
                "Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
                "SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
                "TxnSignature": "30450221009C195DBBF7967E223D8626CA19CF02073667F2B22E206727BFE848FF42BEAC8A022048C323B0BED19A988BDBEFA974B6DE8AA9DCAE250AA82BBD1221787032A864E5"
            }
        }, {
            "Signer": {
                "Account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
                "SigningPubKey": "028FFB276505F9AC3F57E8D5242B386A597EF6C40A7999F37F1948636FD484E25B",
                "TxnSignature": "30440220680BBD745004E9CFB6B13A137F505FB92298AD309071D16C7B982825188FD1AE022004200B1F7E4A6A84BB0E4FC09E1E3BA2B66EBD32F0E6D121A34BA3B04AD99BC1"
            }
        }],
        "SigningPubKey": "",
        "TransactionType": "TrustSet",
        "hash": "BD636194C48FD7A100DE4C972336534C8E710FD008C0F3CF7BC5BF34DAF3C3E6"
}'
Submit-MultiSigned -TxJSON $myMultiTx -ToString

Send-CustomTx

Submits any user defined command in JSON format to the websocket server.

  • [string] txJSON | The user-defined command to submit, in JSON format. Technically this is a string in powershell.
  • [switch] ToString | (optional) Toggles whether to return readable JSON to the console instead of a PS object. Defaults to false.
$txJSON =
'{
    "id": 1337,
    "command": "account_lines",
    "account": "rpbvDUFjb1RZYfMGoy8ki8itHNEXaeCALE",
    "ledger": "current"
}'
Send-CustomTx $txJSON