const new_token_account = anchor.web3.Keypair.generate();
// and on tx builder, include the new_token_account as singer
.signers([new_token_account]).rpc()
This file contains hidden or 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
// Define the size of each chunk | |
const chunkSize = 1000; | |
// Create a function to iterate over the items in chunks | |
async function iterateInChunks(items: any[], callback: (chunk: any[]) => void) { | |
// Calculate the number of chunks | |
const numChunks = Math.ceil(items.length / chunkSize); | |
// Create an array to hold the promises for the async operations | |
const promises = []; |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.7.0 <0.9.0; | |
import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
contract AMM is ReentrancyGuard{ | |
using Counters for Counters.Counter; | |
Counters.Counter private caseID; |
This file contains hidden or 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
{ | |
header: { | |
numRequiredSignatures: 2, | |
numReadonlySignedAccounts: 0, | |
numReadonlyUnsignedAccounts: 2 | |
}, | |
accountKeys: [ | |
PublicKey { | |
_bn: <BN: ac0c28f702f61dca52e1e6260991e7db6bc3abbc0956434c9cbf0046b384ed5> | |
}, |
This file contains hidden or 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
await fetch("https://account.proton.me/api/users/available?Name=0xdeepmehta%40protonmail.com&ParseDomain=1", { | |
"headers": { | |
"accept": "application/vnd.protonmail.v1+json", | |
"accept-language": "en-GB,en;q=0.6", | |
"cache-control": "no-cache", | |
"pragma": "no-cache", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", | |
"sec-fetch-site": "same-origin", | |
"sec-gpc": "1", |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or 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
Accounts | |
4SAKbvUL9S3HqMAaiStuycCAxreKYzCEVgz5mjddS63d | |
9MqSqfMnFURhSK7Qouinjzs8Jei7ZfAiq3jkZa8bpwDh | |
HzQUHdhT6DHNr5kgNYgZtQ7cgMYi5ygc8ptBZo1k5v1Z | |
919mqjGT1nxig7qxUBhhzWSg9bX8vU6z1KbB2iiLT3xh | |
98dormQvMenmn6wZjzkgvvKNMmbSDMfaMcNrzP4GJWux | |
vHeXX3pKFj5f9ZgwU8zDZHJwGooXzeotho8QSCAWFTh | |
EEdCJ2giRpW2RyjQSJwm3rdAU7RBTSm7rWdA2iszJx3a | |
3wsmFazBaGpVgFR7ZZfWgiaLbmUpKAox11EKDcith6WX | |
HeUweiQ6vQnPeTSN9hXorCZiZpF2iZzCL8bod4kZtpiv |
I hereby claim:
- I am 0xdeepmehta on github.
- I am 0xdeep (https://keybase.io/0xdeep) on keybase.
- I have a public key ASAc7aDaxliaTiue5o7P9My2K1gtw5Jvh6vuwkQsr1S9Pwo
To claim this, I am signing this object:
I’ve been lucky to work primarily in systems where each of these pieces is type safe. At Twitch, we used PostgreSQL
for data, Golang for backend, GraphQL for APIs, and React + TypeScript for the front end. Each piece was type safe, and tools like GraphQL allowed us to write a “type contract” between different type systems (in this case a GraphQL schema).
use anchor_lang::prelude::*;
use anchor_lang::solana_program::{program::invoke ,system_instruction::transfer};
declare_id!("CR7XiGZHEu588YMkg2RPtyokwhawwEczcHHznXM6NwG7");
This file contains hidden or 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 { | |
Connection, | |
clusterApiUrl, | |
ConfirmedSignatureInfo, | |
PublicKey, | |
} from "@solana/web3.js"; | |
import * as anchor from "@project-serum/anchor"; | |
describe("ohana-contract", () => { | |
const connection = new Connection(clusterApiUrl("mainnet-beta")); |
This file contains hidden or 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
var axios = require('axios'); | |
var data = JSON.stringify({ | |
"username": "coolkid", | |
"logo_cid": "ohfuckthecidbish", | |
"bio": "hey bish", | |
"token_name": "BISH", | |
"token_address": "aahbishtheid", | |
"fund_target": 40, | |
"fund_duration": 50, | |
"fund_distributed": [] |