Skip to content

Instantly share code, notes, and snippets.

Wietse Wind WietseWind

Block or report user

Report or block WietseWind

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@WietseWind
WietseWind / ripple-xrp.js
Created Oct 25, 2017
Ripple XRP API (NodeJS) - Send XRP
View ripple-xrp.js
var RippleAPI = require('ripple-lib').RippleAPI
var api = new RippleAPI({ server: 'wss://s1.ripple.com' }) // Public rippled server
var myAddress = 'xxxxxxx'
var mySecret = 'yyyyyyy'
api.on('error', function (errorCode, errorMessage) {
console.log(errorCode + ': ' + errorMessage)
})
api.on('connected', function () {
@WietseWind
WietseWind / transaction.js
Last active Mar 11, 2020
Send XRP transaction to Ripple XRP Ledger
View transaction.js
/**
* Use: node transaction.js AMOUNT:FROMADDR:TOADDR:TOTAG
* eg: node transaction.js 10:rXXXXXXX:rXXXXXX:1337
* To be able to sign the transaction, the object 'wallets'
* below should contain the secret key for the used from-wallet.
*/
const RippleAPI = require('ripple-lib').RippleAPI
const api = new RippleAPI({ server: 'wss://s1.ripple.com' }) // Public rippled server
const fetch = require('node-fetch')
@WietseWind
WietseWind / instruction.md
Last active Feb 19, 2020
Raspbian NOOBS Lite in Kiosk Mode
View instruction.md
  1. Install Raspbian NOOBS without additional software (Lite)
  2. Install the LCD driver (in my case: https://github.com/goodtft/LCD-show)
  3. sudo apt-get install chromium x11-xserver-utils unclutter
  4. Edit /etc/xdg/lxsession/LXDE-pi/autostart, add (change the URL):
@xscreensaver -no-splash
@xset s off
@xset -dpms
@xset s noblank
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' /home/pi/.config/chromium/Default/Preferences
@WietseWind
WietseWind / CHANGELOG.md
Last active Feb 7, 2020
XUMM private Beta 0.1.2 - Changelog
View CHANGELOG.md

2nd XUMM private Beta (v0.1.2)

After a crazy amount of great input from the XRP Community beta testers (🍻❤️) we designed and coded and released this new XUMM beta.

PLEASE NOTE! PLEASE REMOVE THE ALREADY INSTALLED APP (WE DIDN'T ADD AN UPGRADE PROCESS), AND START THE INSTALL PROCESS OVER AGAIN.

(If you don't remove & reinstall but update, the app will crash at startup)

Almost all your input has been processed, and (we hope) all issues are resolved. We are working on the last improvements.

Major improvements and additions include:

@WietseWind
WietseWind / sort.js
Created Feb 7, 2020
Sort on custom attr. + rippled version sort
View sort.js
const fetch = require('node-fetch')
const rippledVersionForSorting = v => {
const vArray = v.split('-')[1].split('.')
if (vArray.length === 3) {
return vArray[0] * 100000 // Major
+ vArray[1] * 1000 // Minor
+ vArray[2] * 10 // Patch
+ Number((v.split('-')[2] || '').replace(/[^0-9]/g, '')) // RC/Beta
}
@WietseWind
WietseWind / sample.sql
Created Jan 9, 2020
Select AccountSet text-fields from XRPL BigQuery dataset
View sample.sql
SELECT
SAFE_CONVERT_BYTES_TO_STRING(FROM_HEX(Domain))
FROM
xrpledgerdata.fullhistory.transactions
WHERE
Account = 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY'
AND TransactionType = 'AccountSet'
AND Domain IS NOT null
ORDER BY
LedgerIndex DESC
@WietseWind
WietseWind / For_ Craig_DeWitt.sql
Created Dec 11, 2019
Find accounts with most account activations (XRPL, BigQuery)
View For_ Craig_DeWitt.sql
-- Remove the surrounding Q3 for a complete list of account activations
SELECT
Account,
COUNT(1) as AccountsActivated
FROM (
SELECT
Q1.*,
Q2.Account,
Q2.hash
View mnemonic-wallet-gen.js
const bip39 = require("bip39");
const bip32 = require("ripple-bip32");
const ripple = require('ripple-keypairs')
var mnemonic = 'novel matter final only nice cheese address cradle civil crash great flame struggle consider crowd surface purpose saddle mango endless mixed trial tape wrap'
// Or generate:
// mnemonic = bip39.generateMnemonic()
console.log('mnemonic: ' + mnemonic)
const seed = bip39.mnemonicToSeed(mnemonic) // add second argument for 25th word encrypted
@WietseWind
WietseWind / index.js
Created Jul 22, 2019
Encode/Decode X-address in the browser (plain HTML+JS)
View index.js
<script src="https://xrpaddress.info/js/xrpl-tagged-address-codec-browser.js"></script>
<script>
var XCodec = require('xrpl-tagged-address-codec')
console.log(XCodec.Encode({ account: 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', tag: 495 }))
console.log(XCodec.Decode('XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD28Sq49uo34VyjnmK5H'))
</script>
@WietseWind
WietseWind / stdsql.sql
Last active Oct 25, 2019
XRPL BigQuery TX per ledger per time frame
View stdsql.sql
SELECT
T.LedgerIndex,
COUNT(1) as TxCount,
MIN(L.CloseTime) as LedgerClosed
FROM xrpledgerdata.fullhistory.transactions as T
JOIN xrpledgerdata.fullhistory.ledgers as L ON (
L.LedgerIndex = T.LedgerIndex
)
WHERE
L.CloseTime > '2019-10-01 12:00:00'
You can’t perform that action at this time.