This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ByteSet { | |
@lazy | |
static readonly dataSize: u32 = 32; | |
constructor(public bytes: ByteArray) { | |
if (bytes.length != ByteSet.dataSize) | |
rollback("", pack_error_code(bytes.length)); | |
} | |
has(n: u8): bool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hook(reserved: i32) | |
{ | |
etxn_reserve(1) | |
const savings_account = new HookParam<Account>({ | |
name: "savings_account", | |
description: 'The account the rounded savings are sent to' | |
}) | |
const dest_accid = savings_account.get( | |
new Account(util_accid("rfCarbonVNTuXckX6x2qTMFmFSnm6dEWGX"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cpt=${PWD##*/} # to assign to a variable | |
cpt=${result:-/} # to correct for the case where PWD=/ | |
cpt=$(printf '%q\n' "${PWD##*/}") | |
cpt=${cpt,,} | |
rm -f /etc/nginx/sites-enabled/$cpt | |
cp /etc/nginx/template/template-vhost /etc/nginx/sites-enabled/$cpt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { XrplClient } from 'xrpl-client' | |
const account = 'rpKJsRsvKXt5JwV2PFRnvfkEH47MEWpVYo' | |
const client = new XrplClient() | |
let marker | |
let pages = 0 | |
let accounts = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Xumm } from 'xumm' | |
import WebSocket from 'ws' | |
const xumm = new Xumm('xxxxxx', 'yyyyyy') | |
const payload = await xumm.payload?.create({ TransactionType: "SignIn" }) | |
console.log(payload.refs.websocket_status) | |
const ws = new WebSocket(payload.refs.websocket_status) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sha512 from 'crypto-js/sha512'; | |
const metadata = { | |
details: { | |
title: 'Some Title' | |
} | |
} | |
const digest = sha512( | |
JSON.stringify(metadata).trim() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface xls35category { | |
code: string | |
description: string | |
} | |
// EXAMPLES (!) | |
export const xls35categories: xls35category[] = [ | |
{ code: '0000', description: 'Testing-purpose token' }, | |
{ code: '0001', description: 'Art' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
const repos = [] | |
const knownRepoCall = await fetch('https://raw.githubusercontent.com/electric-capital/crypto-ecosystems/master/data/ecosystems/x/xrp.toml') | |
const knownRepoData = await knownRepoCall.text() | |
for (let page = 1; page < 10; page++) { | |
const call = await fetch('https://api.github.com/search/repositories?q=xrp+xrpl&order=desc&per_page=1000&page=' + page) | |
const json = await call.json() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
import {createHmac} from 'crypto' | |
const endpoint = 'xxxxxx | |
const key = 'yyyyyy' | |
const secret = 'xxxxxxxx' | |
const banxaCall = async (path, body, method = 'GET') => { | |
const nonce = Math.round(new Date() / 1000) |