View index.mjs
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 config = { backfillLedgers: 20, lastLedger: null } | |
const client = new XrplClient(['wss://xrplcluster.com']) | |
await client.ready() | |
config.lastLedger = client.getState().ledger.last - config.backfillLedgers | |
function getLedgerTransactions(ledger_index) { | |
return client.send({ command: 'ledger', transactions: true, expand: true, ledger_index }) |
View user-profile-script.js
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(accessToken, ctx, callback) { | |
const url = "https://oauth2.xumm.app/userinfo"; | |
request.get( | |
{ url, headers: { 'Authorization': 'Bearer ' + accessToken, } }, | |
(err, resp, body) => { | |
if (err) { | |
return callback(err); | |
} | |
if (resp.statusCode !== 200) { |
View pkce-implicit.html
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
<html> | |
<title>OAuth Authorization Code + PKCE in Vanilla JS</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | |
<!-- Credits: https://github.com/aaronpk/pkce-vanilla-js/blob/master/index.html --> | |
<script> | |
// Configure your application and authorization server details | |
var config = { | |
client_id: "<The Xumm App API key (public)>", |
View build.sh
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 | |
rm ./module.wasm | |
rm ./module.wat | |
node assemblyscript/bin/asc \ | |
-O3 \ | |
--noAssert \ | |
--runtime minimal \ | |
--textFile ./module.wat \ |
View starter.c
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
/** | |
* This hook just accepts any transaction coming through it | |
*/ | |
#include "hookapi.h" | |
int64_t cbak(int64_t reserved) { | |
return 0; | |
} | |
int64_t hook(int64_t reserved ) { |
View blacklist.c
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
#include "hookapi.h" | |
/* | |
Blacklist signing keys ((( you should change these ))) | |
r.deriveKeypair('sEd7CGWXiFPazNncZJsxD11h1sHJCtm') | |
{ | |
privateKey: 'ED55D3A139AF8F069FE93BB943FE3A46BAF70EA61E0DD02192D4A532D8E87627F0', | |
publicKey: 'EDDC6D9E28CA0FE2D475FC021D226881666EA106FBD2222C8C2110368A49C9513C' | |
} | |
the public key is encoded below, you should change this | |
*/ |
View notary.c
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
/** | |
* Notary.c - An example hook for collecting signatures for multi-sign transactions without blocking sequence number | |
* on the account. | |
* | |
* Author: Richard Holland | |
* Date: 11 Feb 2021 | |
* | |
**/ | |
#include <stdint.h> |
View carbon.c
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
#include <stdint.h> | |
#include "hookapi.h" | |
int64_t cbak(int64_t reserved) | |
{ | |
return 0; | |
} | |
int64_t hook(int64_t reserved ) { |
View peggy.c
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
/** | |
* Peggy.c - An oracle based stable coin hook | |
* | |
* Author: Richard Holland | |
* Date: 1 Mar 2021 | |
* | |
**/ | |
#include <stdint.h> | |
#include "hookapi.h" |
View index.js
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
const {Account} = require('xrpl-secret-numbers') | |
const secret = '399150 474506 009147 088773 XXXXXX XXXXXX XXXXXX XXXXXX' | |
const account = new Account(secret) | |
console.log(account.getFamilySeed()) |
NewerOlder