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 { | |
DriftClient, | |
AuctionSubscriber, | |
Wallet, | |
DRIFT_PROGRAM_ID, | |
} from '@drift-labs/sdk' | |
import { Connection, Keypair, PublicKey } from '@solana/web3.js'; | |
const main = async () => { | |
const connection = new Connection("ur own working rpc"); |
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
from solana.rpc.async_api import AsyncClient | |
from solders.keypair import Keypair | |
from anchorpy import Wallet | |
from driftpy.drift_client import DriftClient | |
from driftpy.account_subscription_config import AccountSubscriptionConfig | |
from driftpy.events.event_subscriber import EventSubscriber | |
from driftpy.events.types import WrappedEvent, EventSubscriptionOptions, WebsocketLogProviderConfig | |
import os |
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
#!//usr/bin/python3 | |
# python env needs base58 package | |
# this format is suitable for raycast script commands! | |
# https://github.com/raycast/script-commands | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Convert Solana Private Key | |
# @raycast.mode fullOutput |
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
use std::error::Error; | |
use anchor_client::{ | |
anchor_lang::__private::base64, | |
solana_sdk::{bs58, signature::Keypair}, | |
}; | |
pub fn read_keypair_str_multi_format(data: String) -> Result<Keypair, Box<dyn Error>> { | |
// strip out any white spaces and new line/carriage return characters | |
let data = data.replace([' ', '\n', '\r'], ""); |
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, Keypair, PublicKey } from '@solana/web3.js'; | |
import { | |
configs, | |
DriftClient, | |
Wallet, | |
} from "@drift-labs/sdk"; | |
async function main() { |
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, Keypair, PublicKey } from '@solana/web3.js'; | |
import { | |
BASE_PRECISION, | |
BulkAccountLoader, | |
configs, | |
convertToNumber, | |
DLOBSubscriber, | |
DriftClient, | |
getMarketsAndOraclesForSubscription, | |
MarketType, |