@opentabs-dev/opentabs-plugin-coinbase 0.0.82 → 0.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/adapter.iife.js
CHANGED
|
@@ -14567,11 +14567,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14567
14567
|
});
|
|
14568
14568
|
|
|
14569
14569
|
// src/tools/compare-asset-prices.ts
|
|
14570
|
-
var buildQuery = (uuids
|
|
14570
|
+
var buildQuery = (uuids) => {
|
|
14571
|
+
const varDefs = uuids.map((_, i) => `$uuid${i}: String!`).join(", ");
|
|
14571
14572
|
const fields = uuids.map(
|
|
14572
|
-
(
|
|
14573
|
+
(_, i) => `a${i}: assetByUuid(uuid: $uuid${i}) { uuid name symbol latestPrice(quoteCurrency: $quoteCurrency) { price timestamp quoteCurrency } }`
|
|
14573
14574
|
).join("\n ");
|
|
14574
|
-
return `query CompareAssetPrices {
|
|
14575
|
+
return `query CompareAssetPrices($quoteCurrency: String!, ${varDefs}) {
|
|
14575
14576
|
${fields}
|
|
14576
14577
|
}`;
|
|
14577
14578
|
};
|
|
@@ -14596,9 +14597,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14596
14597
|
assets: external_exports.array(priceComparisonSchema).describe("Assets with their current prices")
|
|
14597
14598
|
}),
|
|
14598
14599
|
handle: async (params) => {
|
|
14599
|
-
const
|
|
14600
|
-
const
|
|
14601
|
-
const
|
|
14600
|
+
const query = buildQuery(params.uuids);
|
|
14601
|
+
const variables = { quoteCurrency: params.quote_currency ?? "USD" };
|
|
14602
|
+
for (const [i, uuid3] of params.uuids.entries()) {
|
|
14603
|
+
variables[`uuid${i}`] = uuid3;
|
|
14604
|
+
}
|
|
14605
|
+
const data = await gql(query, variables);
|
|
14602
14606
|
const assets = params.uuids.map((_, i) => {
|
|
14603
14607
|
const a = data[`a${i}`] ?? {};
|
|
14604
14608
|
return {
|
|
@@ -14893,7 +14897,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14893
14897
|
};
|
|
14894
14898
|
var src_default = new CoinbasePlugin();
|
|
14895
14899
|
|
|
14896
|
-
// dist/
|
|
14900
|
+
// dist/_adapter_entry_899c1858-2642-4c74-ada5-7105ec5b8fcb.ts
|
|
14897
14901
|
if (!globalThis.__openTabs) {
|
|
14898
14902
|
globalThis.__openTabs = {};
|
|
14899
14903
|
} else {
|
|
@@ -15109,5 +15113,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15109
15113
|
};
|
|
15110
15114
|
delete src_default.onDeactivate;
|
|
15111
15115
|
}
|
|
15112
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["coinbase"]){var a=o.adapters["coinbase"];a.__adapterHash="
|
|
15116
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["coinbase"]){var a=o.adapters["coinbase"];a.__adapterHash="06d0d31ae361563f2e5efede8aba673546cff6178326610156d240118ced247e";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"coinbase",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
15113
15117
|
//# sourceMappingURL=adapter.iife.js.map
|