Skip to content

Instantly share code, notes, and snippets.

View rubpy's full-sized avatar
💭
💥 Phosphorylating

pr3 🪤 rubpy

💭
💥 Phosphorylating
View GitHub Profile
import web3 from "@solana/web3.js";
import * as BufferLayout from "@solana/buffer-layout";
import QuickLRU from "quick-lru";
////////////////////////////////////////////////////////////////////////////////
export class BorshBoolean extends BufferLayout.Layout<boolean> {
constructor(property?: string) {
super(1, property);
(function (rpcEndpoint) {
if (typeof rpcEndpoint !== "string" || !rpcEndpoint.length) return -1;
rpcEndpoint = rpcEndpoint.trim();
const wsEndpoint = rpcEndpoint.replace(/^http(s?)/gm, "ws$1");
const root = document.getElementById('root');
if (!root) return -2;
const reactId = Object.keys(root).find(s => s.startsWith("__reactContainer"));
if (root[reactId] === null || typeof root[reactId] !== "object" || !root[reactId].stateNode) return -2;
let ctx = root[reactId].stateNode;
<?php
//
// NOTE: only one dependency is needed: `firebase/php-jwt`.
// (install using: `composer require firebase/php-jwt`)
//
require(dirname(__FILE__) . "/vendor/autoload.php");
////////////////////////////////////////////////////////////////////////////////
{
"address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA",
"metadata": {"name": "pump_amm", "version": "0.1.0", "spec": "0.1.0", "description": "Created with Anchor"},
"instructions": [
{
"name": "buy",
"discriminator": [102, 6, 61, 18, 1, 218, 235, 234],
"accounts": [
{"name": "pool"},
{"name": "user", "writable": true, "signer": true},