UNPKG

@bluefin-exchange/bluefin7k-aggregator-sdk

Version:
50 lines (49 loc) 1.37 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Config = void 0; const client_1 = require("@mysten/sui/client"); const pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js"); const HERMES_API = "https://hermes.pyth.network"; const WORMHOLE_STATE_ID = "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c"; const PYTH_STATE_ID = "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"; let apiKey = ""; let suiClient = new client_1.SuiClient({ url: (0, client_1.getFullnodeUrl)("mainnet"), }); let pythClient = new pyth_sui_js_1.SuiPythClient(suiClient, PYTH_STATE_ID, WORMHOLE_STATE_ID); let pythConnection = new pyth_sui_js_1.SuiPriceServiceConnection(HERMES_API); function setApiKey(key) { apiKey = key; } function getApiKey() { return apiKey; } function getSuiClient() { return suiClient; } function setSuiClient(client) { suiClient = client; } function setPythClient(client) { pythClient = client; } function getPythClient() { return pythClient; } function setPythConnection(connection) { pythConnection = connection; } function getPythConnection() { return pythConnection; } const Config = { setApiKey, getApiKey, setSuiClient, getSuiClient, setPythClient, getPythClient, setPythConnection, getPythConnection, }; exports.Config = Config;