initial the DriftClient but got Error: 410 Gone: {"jsonrpc":"2.0","error":{"code": 410, "message":"The RPC call or parameters have been disabled."}
Closed this issue · 1 comments
kkmikako commented
Initializing DriftClient using the following two methods resulted in Error: 410 Gone: {"jsonrpc": "2.0", "error": {"code": 410, "message": "The RPC call or parameters have been disabled."}
`
let base58PrivateKey =
"xxxxxxx"; //
let secretKey = Uint8Array.from(decode(base58PrivateKey));
let keypair = Keypair.fromSecretKey(secretKey);
let connection = new Connection(
"https://api.mainnet-beta.solana.com"
);
const driftClient = new DriftClient({
connection,
wallet,
env: 'mainnet-beta',
});
await driftClient.subscribe();
`
or
`
let base58PrivateKey =
"xxxxxxx"; //
let secretKey = Uint8Array.from(decode(base58PrivateKey));
let keypair = Keypair.fromSecretKey(secretKey);
let connection = new Connection(
"https://api.mainnet-beta.solana.com"
);
const env = "mainnet-beta";
// Initialize Drift SDK
const sdkConfig = initialize({ env });
// Set up the Provider
const provider = new AnchorProvider(
connection,
wallet as any,
AnchorProvider.defaultOptions()
);
const driftPublicKey = new PublicKey(sdkConfig.DRIFT_PROGRAM_ID);
const bulkAccountLoader = new BulkAccountLoader(
connection,
"confirmed",
1000
);
const driftClient = new DriftClient({
connection,
wallet: provider.wallet,
programID: driftPublicKey,
...getMarketsAndOraclesForSubscription(env),
accountSubscription: {
type: "polling",
accountLoader: bulkAccountLoader,
},
});
await driftClient.subscribe();
`