@orca-so/whirlpool-sdk
Version:
Whirlpool SDK for the Orca protocol.
31 lines (30 loc) • 1.41 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDefaultOffchainDataURI = exports.getDefaultConnection = exports.defaultNetwork = exports.defaultSlippagePercentage = void 0;
const web3_js_1 = require("@solana/web3.js");
const percentage_1 = require("../utils/public/percentage");
const network_1 = require("./public/network");
exports.defaultSlippagePercentage = percentage_1.Percentage.fromFraction(1, 1000); // 0.1%
exports.defaultNetwork = network_1.OrcaNetwork.MAINNET;
function getDefaultConnection(network) {
switch (network) {
case network_1.OrcaNetwork.MAINNET:
return new web3_js_1.Connection("https://api.mainnet-beta.solana.com", "processed");
case network_1.OrcaNetwork.DEVNET:
return new web3_js_1.Connection("https://api.devnet.solana.com", "processed");
default:
throw new Error(`type ${network} is an Unknown network`);
}
}
exports.getDefaultConnection = getDefaultConnection;
function getDefaultOffchainDataURI(network) {
switch (network) {
case network_1.OrcaNetwork.MAINNET:
return "https://mainnet-zp2.orca.so";
case network_1.OrcaNetwork.DEVNET:
return "https://devnet-zp2.orca.so";
default:
throw new Error(`type ${network} is an Unknown network`);
}
}
exports.getDefaultOffchainDataURI = getDefaultOffchainDataURI;
;