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 that converts a Rust enum to a string. | |
* Example rust: { switchboard: {} } -> ts: Switchboard | |
* @param value Rust enum value | |
*/ | |
public static convertRustEnumValueToString(value: any) { | |
// get the key of the enum | |
let key = Object.keys(value)[0]; | |
// capitalize first letter | |
key = key.charAt(0).toUpperCase() + key.slice(1); |
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 MerkleDistributor from '@jup-ag/merkle-distributor-sdk'; | |
import { AnchorProvider, Wallet } from '@coral-xyz/anchor'; | |
import { Connection, Keypair, PublicKey } from '@solana/web3.js'; | |
/** | |
* MerkleClaimChecker is a class that can be used to check if an address has already claimed a Merkle airdrop. | |
* Example usage: | |
* const merkleClaimChecker = MerkleClaimChecker.create() | |
* .setRpcUrl(rpcConnectionUrl) | |
* .setDefaultWallet() |
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 { Connection, SendOptions } from '@solana/web3.js'; | |
export type JitoRegion = 'mainnet' | 'amsterdam' | 'frankfurt' | 'ny' | 'tokyo'; | |
export const JitoEndpoints = { | |
mainnet: 'https://mainnet.block-engine.jito.wtf/api/v1/transactions', | |
amsterdam: 'https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions', | |
frankfurt: 'https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions', | |
ny: 'https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions', | |
tokyo: 'https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions', | |
}; | |
export function getJitoEndpoint(region: JitoRegion) { |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"Address": "AeEezz9Gz6aDKfT1j4Zjn5BUV3CdwRNZDS1DdiE2RKEw", | |
"Amount": 500000 | |
}, | |
{ | |
"Address": "3gg1jbrxUqhEPBxV6pB4GkLJzjLsmdRQT4qUFXXQLQyS", | |
"Amount": 500000 | |
}, | |
{ |
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"; | |
export interface DomainLookupResponse { | |
s: string; | |
result: { | |
key: string; | |
domain: string; | |
}[]; | |
} | |
export async function getDomainFromAddress(address: string): Promise<string | null> { | |
const url = `https://sns-sdk-proxy.bonfida.workers.dev/domains/${address}`; |
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
recipient | quantity | |
---|---|---|
8J764UPFVcXtjFcXwnT8gpMYA7kBrKCHruEusczDYRvu | 150 | |
Cq75c8JyWbUqcb9uAVtkM8vUJ5L8qMe8gdhEYyk9GCKF | 122 | |
9g5tovmmBNZrRZqHK4i5PjxELp1xRWpZWJB9h3j4aUnB | 101 | |
BdtiQMAL3mpvbvGncmdtakFERCf8dng9eTnY2MGgRngY | 81 | |
2VqSoU8H3ByTzYiyDG8ZTazcDGimJ52hdVbmE1gvLQa2 | 81 | |
GhuBeitd7eh8KwCurXy1tFCRxGphpVxa8X4rUX8dQxHc | 71 | |
DjXKETEYzkkG6YzegWgy78vpaPH1eBxaiGTVoQrkQNFP | 70 | |
HAwiWQnFY4vuEfWaZbF6LAvLuGUsrk5mtdQF8rDNYh3b | 70 | |
67HB1DLUttZdbTdmiNhY4ehcr6WCs6PdHH6Y9dr6es39 | 67 |
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 AdapterResponse { | |
// User's address | |
address: string; | |
// Number of tokens, should already be scaled for UI display | |
tokens: number; | |
// Whether the user is eligible (we can calculate based on tokens if not available) | |
isEligible: boolean; | |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"wallet": "457pyVt8SvR9aa2nvGBguE1maxczcJHHh2oAYgVkXGSX", | |
"holder_type": "wallet", | |
"hxro": 400 | |
}, | |
{ | |
"wallet": "AC5RDfQFmDS1deWZos921JfqscXdByf8BKHs5ACWjtW2", | |
"holder_type": "wallet", | |
"hxro": 400 |
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
CccUdXroFH81QMLpB9HeGBcLXEYx7fNDfJ4ePcCWJFVF,217 | |
4zdNGgAtFsW1cQgHqkiWyRsxaAgxrSRRynnuunxzjxue,192 | |
1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix,64 | |
7vBHS6d5bbUxYhTTcdsmXkCbcsobwmN7ZqTBVTHk6wvP,54 | |
12yhqBK95GENSocv83WHojvrKWdxJzJWRE5riXDq1eV5,41 | |
2MnmpzX213VVApFdHBiQLQRpjYiCjHVvewmz8rENYA3q,38 | |
7iPoDrXP8hFAJgCheLV7AFHrgmAHj8Fgh1VTgZyeeJs6,37 | |
DY9B65fruzWe1wQLGsy3JHLaFBikvSfKjEnWTMaf5wJh,36 | |
6wv6uc1TQDsTPBDrQnomcVpabi7SVRXZ2XaQmWWnjM5E,33 | |
9cLPCaR1Z9tDdqv5SxAVHsVRJY8HYgJXi2sDtijNqYzV,23 |
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 AssetResults { | |
totalResults: number; | |
results: any[]; | |
} | |
async function getAssetsByGroup({ | |
creatorAddress, | |
apiKey | |
}: { | |
creatorAddress: string; |