Skip to content

Instantly share code, notes, and snippets.

@shortthefomo
shortthefomo / atm.js
Last active November 11, 2024 12:27
all the money
const { XrplClient } = require('xrpl-client')
const xrpl = new XrplClient()
// change this code to a different currency code one of others published, AUD/CAD/CHF/CNY/EUR/GBP/JPY/USD
let code = 'AUD'
if (code.length > 3) {
const characters = Buffer.from(code, 'utf8').toString('hex')
let s = '0'
for (let index = 1; index < 40 - characters.length; index++) {
@shortthefomo
shortthefomo / .txt
Last active September 25, 2024 00:05
validator latency from different nodes
ignore first, node connected to, the validator key, country, validations recieved, average latency, ignore last
valitations:stream 135.181.218.163, nHUh6VZ8vki53PXSKUyth8bu9Sv2GhpbGHXEMo1sedGkkYWGxJ4z, US, 153, 395 +0ms
valitations:stream 135.181.218.163, nHBtnUAYCLpjaDLUaZSU6GcdR6CZctHL4kRU9CHFqs3QpUvPFYWo, NL, 153, 401 +0ms
valitations:stream 135.181.218.163, nHUpDEZX5Zy9auiu4yhDmhirNu6PyB1LvzQEL9Mxmqjr818w663q, FI, 154, 404 +0ms
valitations:stream 135.181.218.163, nHU4ywsSDjE75KN4xh6JKbrW1QSx6hgstJc5rQhbUM2DstEc627u, FR, 152, 424 +0ms
valitations:stream 135.181.218.163, nHUaR13roC3qJdcwu3Tvef3GGuS14T86mq6LPEwpw2DTqu1CUAq8, DE, 154, 431 +0ms
valitations:stream 135.181.218.163, nHU4bLE3EmSqNwfL4AP1UZeTNPrSPPP6FXLKXo2uqfHuvBQxDVKd, US, 154, 442 +0ms
valitations:stream 135.181.218.163, nHUxjxKPeErbN7pNk9UWA5Ee7ZPMtesSeRGJtmdqkTxe94tqM2YX, JP, 154, 444 +0ms
@shortthefomo
shortthefomo / websocketpairs.json
Created September 2, 2024 19:01
websocket pairs open
threexrp:gateway:connector Pairs {
'Kucoin-USDC': 'XRP/USDC',
'Kucoin-USDT': 'XRP/USDT',
'Kucoin-BTC': 'XRP/BTC',
'Kucoin-ETH': 'XRP/ETH',
'btcturk-TRY': 'XRP/TRY',
'valr-ZAR': 'XRP/ZAR',
'valr-USDC': 'XRP/USDC',
'valr-USDT': 'XRP/USDT',
'valr-BTC': 'XRP/BTC',
@shortthefomo
shortthefomo / fetch.js
Last active November 11, 2024 12:27
Fetch USD price XRPL - DEVNET THREE ORACLE
const { XrplClient } = require('xrpl-client')
const xrpl = new XrplClient()
// change this code to a different currency code one of others published, EUR/ZAR/MXN/JPY/BTC/USDT......
let code = 'USD'
if (code.length > 3) {
const characters = Buffer.from(code, 'utf8').toString('hex')
let s = '0'
for (let index = 1; index < 40 - characters.length; index++) {
@shortthefomo
shortthefomo / example.js
Created November 3, 2023 14:42
payment
const { XrplClient } = require('xrpl-client')
const payment = {
"TransactionType" : "Payment",
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Destination" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"Amount" : {
"currency" : "USD",
"value" : "1",
"issuer" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
@shortthefomo
shortthefomo / .txt
Last active October 1, 2023 20:05
exchange pairs three
{
tidex: [ 'USDT', 'BSDT', 'USDC', 'BTC', 'ETH' ],
localtrade: [ 'USDT', 'BTC' ],
'ripio-trade': [ 'BRL' ],
coinbase: [ 'USD', 'EUR', 'GBP', 'USDT' ],
ndax: [ 'CAD', 'USD'],
trubit: [ 'USDT', 'USDC', 'BTC', 'MMXN' ],
pionex: [ 'USDT', 'BTC' ],
changelly: [ 'USDT', 'USDC', 'DAI', 'BTC', 'ETH' ],
bitget: [ 'BTC', 'ETH', 'USDT', 'USDC' ],
@shortthefomo
shortthefomo / uri_token_hook.c
Last active August 1, 2023 20:06
URIToken hook
#include "hookapi.h"
#define MIN_XRP_AMOUNT 100000000 // 100 XRP in drops
#define ISSUER_ACCOUNT "rL4usRexjgCPTG8RoZvVHXmUjuYdWbRx2T"
#define MY_ACCOUNT "rL4usRexjgCPTG8RoZvVHXmUjuYdWbRx2T"
int64_t hook(uint32_t reserved) {
TRACESTR("HookOnURITokenCreateSellOffer: Start.");
@shortthefomo
shortthefomo / mem.js
Last active July 26, 2023 17:52
websocket memory
const WebSocketServer = require('ws').Server
// dissable the perMessageDeflate this causes memory fragmentation!!!!!
const wss = new WebSocketServer({ port: process.env.APP_PORT, perMessageDeflate: false })
wss.on('connection', (ws, req) => {
ws.on('message', (data) => {
// do something
})
ws.on('close', () => {
'use strict'
/**
* Keep a transaction window.
*/
module.exports = class TransactionWindow {
// First in First out
constructor(name, time = null) {
this.name = name
@shortthefomo
shortthefomo / example-socket.js
Last active October 3, 2024 02:13
threexrp public socket
const socketURL = 'wss://three-dev.panicbot.xyz'
const socket = new WebSocket(socketURL)
socket.onopen = function (message) {
//connection string
socket.send(JSON.stringify({
op: 'subscribe',
channel: 'threexrp'
}))