mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
Add create AMM tutorial
Add an interactive tutorial for creating an automated market maker, updated with the latest changes from the Ripple Open Source site.
This commit is contained in:
18
content/_code-samples/create-amm/js/connect.js
Normal file
18
content/_code-samples/create-amm/js/connect.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// In browsers, use a <script> tag. In Node.js, uncomment the following line:
|
||||
// const xrpl = require('xrpl')
|
||||
|
||||
const WS_URL = 'wss://amm.devnet.rippletest.net:51233/'
|
||||
const EXPLORER = 'amm-devnet.xrpl.org' // Optional, for linking
|
||||
|
||||
async function main() {
|
||||
// Define the network client
|
||||
const client = new xrpl.Client(WS_URL)
|
||||
await client.connect()
|
||||
|
||||
// ... custom code goes here
|
||||
|
||||
// Disconnect when done (If you omit this, Node.js won't end the process)
|
||||
await client.disconnect()
|
||||
}
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user