Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Wietse Wind WietseWind

🎯
Focusing
View GitHub Profile
@WietseWind
WietseWind / inject.js
Created Jun 13, 2021
livenet.xrpl.org: ugly XUMM KYC injection
View inject.js
// Sample: try URL:
// https://livenet.xrpl.org/accounts/rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ
window.fetch('https://xumm.app/api/v1/platform/kyc-status/' + document.querySelector('h2.classic').textContent)
.then(r => r.json())
.then(r => r.kycApproved)
.then(r => {
if (r) {
var kyc = document.createElement('img')
kyc.width = 120
@WietseWind
WietseWind / racadm.bash
Created May 10, 2021
Install racadm Ubuntu
View racadm.bash
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-cmpi-devel/libcmpicppimpl0_2.0.3-0ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/s/sblim-sfcb/sfcb_1.4.9-0ubuntu5_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfc-common/libsfcutil0_1.0.1-0ubuntu4_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/multiverse/c/cim-schema/cim-schema_2.48.0-0ubuntu1_all.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/openwsman_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/sblim-sfcc/libcimcclient0_2.2.8-0ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-server1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman1_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-client4_2.6.5-0ubuntu3_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/o/openwsman/libwsman-curl-client-trans
@WietseWind
WietseWind / index.js
Last active Apr 25, 2021
Fetch all Trust Lines for an XRPL account
View index.js
const Client = require('rippled-ws-client')
const main = async () => {
const client = await new Client('wss://xrplcluster.com')
let fetchMore = true
let marker = undefined
const lines = []
@WietseWind
WietseWind / links.md
Created Apr 21, 2021
NY XRPL Meetup links
View links.md
@WietseWind
WietseWind / 1-accountset.json
Last active Mar 6, 2021
Issue tokens (NFT) on the XRPL as discussed in XLS-14d - https://github.com/XRPLF/XRPL-Standards/discussions/30
View 1-accountset.json
{
"TransactionType": "AccountSet",
"Account": "rIssuingAccount...",
"SetFlag": 8
}
@WietseWind
WietseWind / index.js
Created Feb 20, 2021
Recover 2 chars Family Seed
View index.js
// Ugly
const kp = require('ripple-keypairs')
// Enter your (faulty) secret here.
let secret = 's...'
let len = secret.length + 1
let alph = 'rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz'
let alphlen = alph.length
@WietseWind
WietseWind / nft.js
Last active Mar 8, 2021
NFT XRPL Balance Parser - as discussed in XLS-14d - https://github.com/XRPLF/XRPL-Standards/discussions/30
View nft.js
// XLS-14d Sample implementation
const xrplValueToNft = value => {
const data = String(Number(value)).split(/e/i)
const finish = returnValue => {
const unsignedReturnValue = returnValue.replace(/^\-/, '')
if (data.length > 1 && unsignedReturnValue.slice(0, 2) === '0.' && Number(data[1]) < -70) {
// Positive below zero amount, could be NFT
return (sign === '-' ? -1 : 1) * Number(
@WietseWind
WietseWind / closedledger.json
Created Feb 5, 2021
Hooks Blog 5 - Consensus
View closedledger.json
{
"accountState" : [
{
"EmittedTxn" : {
"Account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Amount" : "16125240",
"Destination" : "rfCarbonVNTuXckX6x2qTMFmFSnm6dEWGX",
"DestinationTag" : 0,
"EmitDetails" : {
"EmitBurden" : "0000000000000003",
@WietseWind
WietseWind / gist.js
Last active Feb 2, 2021
Convert address/secret from non XRPL to XRPL (if different alphabet)
View gist.js
const bx = require('base-x')
const cCSC = bx('cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz')
const cXRP = bx('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz')
const csc_decoded = cCSC.decode('sssssssssssssssssssssss')
console.log({csc_decoded})
const xrp_encoded = cXRP.encode(csc_decoded)
@WietseWind
WietseWind / index.js
Last active Nov 20, 2020
Generate ETH account from XRPL Secret Numbers (node)
View index.js
const {Account} = require('xrpl-secret-numbers')
const EthWallet = require('ethereumjs-wallet').default
const XrplAccount = new Account() // Empty = generate, input = derive
console.log(`\n Imported/generated account secret numbers\n `,
XrplAccount.getSecret().join(' '))
console.log(`\n Imported/generated account address\n `,
XrplAccount.getAddress())
console.log(`\n Imported/generated account family seed\n `,