@ixily/activ
Version:
Alpha Capture Trade Idea Verification. Blockchain ownership proven trade ideas and strategies.
52 lines • 2.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GET_PRICE_COINMARKETCAP_V2 = void 0;
const testPricing = async (params) => {
const headers = {
// 'Content-Type': 'application/default+json; charset=utf-8',
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
Accept: '*/*',
Connection: 'keep-alive',
'X-CMC_PRO_API_KEY': params.key,
};
const requestRecipe = {
url: 'https://api.ixily.io/v1/proxy',
method: 'POST',
body: JSON.stringify({
url: 'https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest?symbol=' +
params.symbol,
method: 'GET',
headers,
}),
headers,
};
const data = (await fetch(requestRecipe.url, requestRecipe).then((res) => res.json())).data[params.symbol][0].quote['USD'];
// must be alphabetical order
const globalPrice = data.price;
const timestamp = Date.now();
const priceObj = {
globalPrice,
provider: 'CoinMarketCap',
symbol: params.symbol,
timestamp,
};
return priceObj;
};
/*
Final action:
Network: Lit Chronicle
Onwer Account Wallet: FIRED! => Mint&Grant&Burned! => SECURED!
PKP id: 2316232605630740772521655096411393640179305801596789871357650281153997400319
PKP public key: 0x0449fa44b5389a80cb1f11b01b8a7880ff71e4618d93943ede5b2bfe24152526596faa3b122c9eb1d1e46f736254828ed6202d697857058f240bcbe0c3ce7bc0d6
PKP ETH: 0xabeB4EEaFa61dd7600E1091BbAc363903355455e
Action ipfsId: Qmd5AuhthaRoVZArX4sq9jLPm8QCKTeg6zwwYdxk7FMRCY
granted?: true
*/
exports.GET_PRICE_COINMARKETCAP_V2 = {
ipfsId: 'Qmd5AuhthaRoVZArX4sq9jLPm8QCKTeg6zwwYdxk7FMRCY',
publicKey: '0x0449fa44b5389a80cb1f11b01b8a7880ff71e4618d93943ede5b2bfe24152526596faa3b122c9eb1d1e46f736254828ed6202d697857058f240bcbe0c3ce7bc0d6',
keyEthAddress: '0xabeB4EEaFa61dd7600E1091BbAc363903355455e',
testPricing,
};
//# sourceMappingURL=get-price-coinmarketcap-v2.js.map