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
/** | |
* @module all-domain-service | |
* utility functions for managing svm domain names | |
*/ | |
import { | |
ANS_PROGRAM_ID, | |
TLD_HOUSE_PROGRAM_ID, | |
getHashedName, | |
NameRecordHeader, |
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 { Keypair, PublicKey } from '@solana/web3.js'; | |
import * as argon2 from 'argon2'; | |
import crypto from 'crypto'; | |
import { sign } from 'tweetnacl'; | |
interface KeygenParams { | |
passCode: string; | |
appName: string; | |
userId?: string; // Optional unique identifier |
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 type RetryConfig = { | |
maxAttempts?: number; | |
initialDelay?: number; | |
maxDelay?: number; | |
backoffFactor?: number; | |
onRetry?: (error: Error, attempt: number) => void; | |
}; | |
export async function retryOnFailure<T>( | |
operation: () => Promise<T>, |
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 { AccountInfo, Connection, PublicKey } from "@solana/web3.js"; | |
import { deserialize, Schema } from "borsh"; | |
/** | |
* Holds the data for the {@link NameRecordHeader} Account and provides de/serialization | |
* functionality for that data | |
*/ | |
export class NameRecordHeaderRaw { | |
// only for normal domains, tld name record might not be working. | |
static async create( |
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 { | |
Commitment, | |
Connection, | |
Context, | |
RpcResponseAndContext, | |
SignatureResult, | |
SignatureStatus, | |
TransactionSignature, | |
} from "@solana/web3.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
import { | |
ANS_PROGRAM_ID, | |
findNameHouse, | |
findNftRecord, | |
getHashedName, | |
getNameAccountKeyWithBump, | |
getParentAccountFromTldHouseAccountInfo, | |
getTldFromTldHouseAccountInfo, | |
NameRecordHeader, | |
NftRecord, |
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 { MainDomain, NameAccountAndDomain, TldParser } from "@onsol/tldparser"; | |
import { Connection, PublicKey } from "@solana/web3.js"; | |
/** | |
* Validates and resolves an Eclipse address or domain to a PublicKey. | |
* Mostly used in searches. | |
* Ideally the value is debounced on typing | |
* | |
* This function can handle two types of input: | |
* 1. An Eclipse domain (e.g., "miester.turbo") |
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 { | |
AddressLookupTableAccount, | |
Blockhash, | |
ComputeBudgetProgram, | |
Connection, | |
Keypair, | |
PublicKey, | |
Transaction, | |
TransactionError, | |
TransactionInstruction, |
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 { | |
Commitment, | |
Connection, | |
Context, | |
RpcResponseAndContext, | |
SignatureResult, | |
SignatureStatus, | |
TransactionSignature, | |
} from "@solana/web3.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
#!/bin/bash | |
# Airdrop amount | |
amount=2 | |
# Number of addresses to generate | |
num_addresses=10 | |
# Address to transfer all tokens to | |
receiver_address="CHANGE ME" |