mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 20:05:50 +00:00
Delegate Permissions (JavaScript) Sample Code
These code samples demonstrate how to delegate permissions to another account and how to send an a transaction as a delegate, using xrpl.js 4.3 in Node.js.
Usage
-
Install dependencies.
npm i -
Run
delegate-permisions.js.node delegate-permissions.jsIf it runs successfully, it should output several things including "Delegate successfully set." followed by an account_objects API method response showing the delegate permissions.
Take note of the Delegator address and Delegate seed from the output.
-
Run
use-delegate-permissions.jsand provide both the delegator's address and the delegate's secret key that were output in the previous step.If it runs successfully, it should output various things ending in the following:
Transaction successful. Domain is example.com