Skip to content

Instantly share code, notes, and snippets.

View ahermida's full-sized avatar

Albert Hermida ahermida

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ahermida on github.
  • I am herm (https://keybase.io/herm) on keybase.
  • I have a public key ASDAZ0ENeYAqRlCZL84HcO6m7eOHZ9LHvyh3q6IWsb7PdAo

To claim this, I am signing this object:

import { Client } from '@elastic/elasticsearch';
import { posts } from 'aleph-js';
import * as fs from 'fs';
const client = new Client({ node: 'http://localhost:9200' });
// Track what has been posted to aleph (by id)
const saved = JSON.parse(fs.readFileSync('~/saved.json', 'utf-8'));
async function run() {
@ahermida
ahermida / genesis.blob
Created September 19, 2022 00:53
genesis
Ä%aclfl°Î  
0:@6v^‘ Ùàá
è ïí
ß
 
 

 

 aclerrorvectorACLaddassert_containscontainsemptyremovelistinvalid_argumentindex_ofaptos::metadata_v0sECONTAIN%The ACL already contains the address. ENOT_CONTAIN%The ACL does not contain the address.
@ahermida
ahermida / job
Created September 21, 2022 16:26
Will fetch a value from on-chain and put it back on-chain!
{
"tasks": [
{
"httpTask": {
"url": "https://fullnode.testnet.aptoslabs.com/v1/accounts/0x790e386260446eeea471da8050103df2b1cbb884a8a120478e04b8c9ff253f2/resource/0xb27f7bbf7caf2368b08032d005e8beab151a885054cdca55c4cc644f0a308d2b::aggregator::Aggregator",
"method": "METHOD_GET"
}
},
{
"jsonParseTask": {
@ahermida
ahermida / txix
Created September 21, 2022 18:39
One chunk
{
"keys": [
{
"pubkey": "L57ecexSPaXqZ3ubfMrjjyWJnCo5ByiSd8hfiTSvXyV",
"isSigner": false,
"isWritable": true
},
{
"pubkey": "4upkSuPTUWJ7uk6TxzmAoqRbW2t1vPrUD7RWkYVNYMWz",
"isSigner": true,
@ahermida
ahermida / txix
Created September 21, 2022 18:39
{
"keys": [
{
"pubkey": "L57ecexSPaXqZ3ubfMrjjyWJnCo5ByiSd8hfiTSvXyV",
"isSigner": false,
"isWritable": true
},
{
"pubkey": "4upkSuPTUWJ7uk6TxzmAoqRbW2t1vPrUD7RWkYVNYMWz",
"isSigner": true,
// SPDX-License-Identifier: UNLICENSED
// This is an interface for interacting with the Receiver contract from Switchboard's Pull Model
pragma solidity ^0.8.9;
// Struct representing a result for a feed and interval
struct Result {
int256 value; // The value of the feed result
uint256 timestamp; // The timestamp of the result
uint256 updatedAt; // The timestamp when the result was last updated
@ahermida
ahermida / gist:bde45365ee3240e93814de5e9b87d4e9
Created May 16, 2024 08:50
Attempt to submit a btc update using Switchboard
import {
getFeedUpdateData,
getDefaultDevnetQueue,
OracleJob,
} from "@switchboard-xyz/on-demand"; // use @switchboard-xyz/on-demand@1.0.54-alpha.3
import { ethers } from "ethers"; // use ethers@^6.12.1
async function getTimeBTC() {
return getFeedUpdateData(
{
@ahermida
ahermida / SwitchboardModule.sol
Created May 16, 2024 08:53
Testnet Flows SB
//SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0 <0.9.0;
import {Structs} from "./structs/Structs.sol";
import {FeedLib} from "./feed/FeedLib.sol";
import {FeedStorage} from "./feed/FeedStorage.sol";
import {QueueLib} from "./queue/QueueLib.sol";
import {QueueStorage} from "./queue/QueueStorage.sol";
import {AggregatorLib} from "./aggregator/AggregatorLib.sol";
import {AggregatorStorage} from "./aggregator/AggregatorStorage.sol";
// Import necessary modules
import { GatewayCache } from "./src/chains/evm/GatewayCache";
import { getIPFSClient } from "./src/ipfs";
import type { FeedHashDefinition } from "./src/util";
import { getDevnetQueue } from "./src/util";
import { OracleJob } from "@switchboard-xyz/common";
import { Gateway } from "@switchboard-xyz/on-demand";
import axios from "axios";
import * as fs from "fs";