Skip to content

Commit

Permalink
Remove CSGOTrader permission
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Feb 5, 2024
1 parent 5910943 commit e4fcb57
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "BetterFloat",
"author": "Rums",
"version": "1.15.3",
"version_name": "1.15.3",
"version": "1.16.0",
"version_name": "1.16.0",
"description": "Enhance your experience on CSFloat.com, Skinport.com & Skinbid.com!",
"manifest_version": 3,
"host_permissions": ["*://prices.csgotrader.app/*", "*://*.csfloat.com/*", "*://*.skinport.com/*", "*://*.skinbid.com/*"],
"host_permissions": ["*://*.csfloat.com/*", "*://*.skinport.com/*", "*://*.skinbid.com/*"],
"background": {
"service_worker": "js/background.js"
},
Expand Down
4 changes: 2 additions & 2 deletions manifest_firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"name": "Rums",
"url": "https://github.com/GODrums"
},
"version": "1.15.3",
"version": "1.16.0",
"description": "Enhance your experience on CSFloat.com, Skinport.com & Skinbid.com!",
"manifest_version": 3,
"host_permissions": ["*://prices.csgotrader.app/*", "*://*.csfloat.com/*", "*://*.skinport.com/*", "*://*.skinbid.com/*"],
"host_permissions": ["*://*.csfloat.com/*", "*://*.skinport.com/*", "*://*.skinbid.com/*"],
"background": {
"scripts": ["js/background.js"]
},
Expand Down
1 change: 1 addition & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const defaultSettings: Extension.Settings = {
priceHigh: 999999,
name: '',
types: [],
new: false,
},
enableSkinbid: true,
skbPriceReference: 0,
Expand Down
11 changes: 11 additions & 0 deletions src/networkhandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BlueGem, Extension } from './@typings/ExtensionTypes';
import { Skinport } from './@typings/SkinportTypes';

export async function fetchCSBlueGem(type: string, paint_seed: number, currency = 'USD') {
return fetch(`https://csbluegem.com/api?skin=${type}&pattern=${paint_seed}&currency=${currency}`)
Expand All @@ -15,3 +16,13 @@ export async function fetchCSBlueGem(type: string, paint_seed: number, currency
export async function isApiStatusOK(): Promise<Extension.ApiStatusResponse> {
return fetch('https://api.rums.dev/v1/betterfloat/status').then((res) => res.json());
}

export async function saveOCOPurchase(item: Skinport.Listing) {
return fetch('https://api.rums.dev/v1/oco/store', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ item }),
});
}
3 changes: 2 additions & 1 deletion src/skinport/content_script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getAllSettings } from '../util/extensionsettings';
import { Euro, USDollar, createUrlListener, getBuffPrice, getFloatColoring, handleSpecialStickerNames, waitForElement } from '../util/helperfunctions';
import { genGemContainer, generateSpStickerContainer } from '../util/uigeneration';
import { Extension } from '../@typings/ExtensionTypes';
import { fetchCSBlueGem } from '../networkhandler';
import { fetchCSBlueGem, saveOCOPurchase } from '../networkhandler';

import getSymbolFromCurrency from 'currency-symbol-map';
import Decimal from 'decimal.js';
Expand Down Expand Up @@ -1156,6 +1156,7 @@ function addInstantOrder(item: Skinport.Listing, container: Element) {
console.log('[BetterFloat] oneClickOrder result: ', result);
if (result) {
showMessageBox('oneClickOrder', 'oneClickOrder was successful.', true);
saveOCOPurchase(item);
}
});
};
Expand Down

0 comments on commit e4fcb57

Please sign in to comment.