@xyo-network/coingecko-crypto-market-plugin 2.74.4 → 2.75.0
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/browser/Config.cjs +19 -0
- package/dist/browser/Config.cjs.map +1 -0
- package/dist/browser/Config.d.mts.map +1 -0
- package/dist/browser/Config.d.ts.map +1 -0
- package/dist/browser/Config.js +1 -0
- package/dist/browser/Config.js.map +1 -0
- package/dist/browser/Plugin.cjs +90 -0
- package/dist/browser/Plugin.cjs.map +1 -0
- package/dist/browser/Plugin.d.mts.map +1 -0
- package/dist/browser/Plugin.d.ts.map +1 -0
- package/dist/browser/Plugin.js +69 -0
- package/dist/browser/Plugin.js.map +1 -0
- package/dist/browser/Schema.cjs +27 -0
- package/dist/browser/Schema.cjs.map +1 -0
- package/dist/browser/Schema.d.mts.map +1 -0
- package/dist/browser/Schema.d.ts.map +1 -0
- package/dist/browser/Schema.js +6 -0
- package/dist/browser/Schema.js.map +1 -0
- package/dist/browser/Witness.cjs +74 -0
- package/dist/browser/Witness.cjs.map +1 -0
- package/dist/browser/Witness.d.mts.map +1 -0
- package/dist/browser/Witness.d.ts.map +1 -0
- package/dist/browser/Witness.js +53 -0
- package/dist/browser/Witness.js.map +1 -0
- package/dist/{index.js → browser/index.cjs} +1 -11
- package/dist/browser/index.cjs.map +1 -0
- package/dist/browser/index.d.mts.map +1 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/{index.mjs → browser/index.js} +1 -1
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/lib/coinGeckoCoinToAssetMap.cjs +41 -0
- package/dist/browser/lib/coinGeckoCoinToAssetMap.cjs.map +1 -0
- package/dist/browser/lib/coinGeckoCoinToAssetMap.d.mts.map +1 -0
- package/dist/browser/lib/coinGeckoCoinToAssetMap.d.ts.map +1 -0
- package/dist/browser/lib/coinGeckoCoinToAssetMap.js +20 -0
- package/dist/browser/lib/coinGeckoCoinToAssetMap.js.map +1 -0
- package/dist/browser/lib/defaults.cjs +43 -0
- package/dist/browser/lib/defaults.cjs.map +1 -0
- package/dist/browser/lib/defaults.d.mts.map +1 -0
- package/dist/browser/lib/defaults.d.ts.map +1 -0
- package/dist/browser/lib/defaults.js +22 -0
- package/dist/browser/lib/defaults.js.map +1 -0
- package/dist/browser/lib/index.cjs +76 -0
- package/dist/browser/lib/index.cjs.map +1 -0
- package/dist/browser/lib/index.d.mts.map +1 -0
- package/dist/browser/lib/index.d.ts.map +1 -0
- package/dist/browser/lib/index.js +53 -0
- package/dist/browser/lib/index.js.map +1 -0
- package/dist/browser/lib/pricesFromCoingecko.cjs +55 -0
- package/dist/browser/lib/pricesFromCoingecko.cjs.map +1 -0
- package/dist/browser/lib/pricesFromCoingecko.d.mts.map +1 -0
- package/dist/browser/lib/pricesFromCoingecko.d.ts.map +1 -0
- package/dist/browser/lib/pricesFromCoingecko.js +34 -0
- package/dist/browser/lib/pricesFromCoingecko.js.map +1 -0
- package/dist/node/Config.d.mts +9 -0
- package/dist/node/Config.d.mts.map +1 -0
- package/dist/node/Config.d.ts +9 -0
- package/dist/node/Config.d.ts.map +1 -0
- package/dist/node/Config.js +17 -0
- package/dist/node/Config.js.map +1 -0
- package/dist/node/Config.mjs +1 -0
- package/dist/node/Config.mjs.map +1 -0
- package/dist/node/Plugin.d.mts +56 -0
- package/dist/node/Plugin.d.mts.map +1 -0
- package/dist/node/Plugin.d.ts +56 -0
- package/dist/node/Plugin.d.ts.map +1 -0
- package/dist/node/Plugin.js +41 -0
- package/dist/node/Plugin.js.map +1 -0
- package/dist/node/Plugin.mjs +17 -0
- package/dist/node/Plugin.mjs.map +1 -0
- package/dist/node/Schema.d.mts +3 -0
- package/dist/node/Schema.d.mts.map +1 -0
- package/dist/node/Schema.d.ts +3 -0
- package/dist/node/Schema.d.ts.map +1 -0
- package/dist/node/Schema.js +29 -0
- package/dist/node/Schema.js.map +1 -0
- package/dist/node/Schema.mjs +5 -0
- package/dist/node/Schema.mjs.map +1 -0
- package/dist/node/Witness.d.mts +10 -0
- package/dist/node/Witness.d.mts.map +1 -0
- package/dist/node/Witness.d.ts +10 -0
- package/dist/node/Witness.d.ts.map +1 -0
- package/dist/node/Witness.js +44 -0
- package/dist/node/Witness.js.map +1 -0
- package/dist/node/Witness.mjs +20 -0
- package/dist/node/Witness.mjs.map +1 -0
- package/dist/node/index.d.mts +8 -0
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/index.d.ts +8 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +40 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +11 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.d.mts +3 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.d.mts.map +1 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.d.ts +3 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.d.ts.map +1 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.js +43 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.js.map +1 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.mjs +19 -0
- package/dist/node/lib/coinGeckoCoinToAssetMap.mjs.map +1 -0
- package/dist/node/lib/defaults.d.mts +4 -0
- package/dist/node/lib/defaults.d.mts.map +1 -0
- package/dist/node/lib/defaults.d.ts +4 -0
- package/dist/node/lib/defaults.d.ts.map +1 -0
- package/dist/node/lib/defaults.js +46 -0
- package/dist/node/lib/defaults.js.map +1 -0
- package/dist/node/lib/defaults.mjs +21 -0
- package/dist/node/lib/defaults.mjs.map +1 -0
- package/dist/node/lib/index.d.mts +4 -0
- package/dist/node/lib/index.d.mts.map +1 -0
- package/dist/node/lib/index.d.ts +4 -0
- package/dist/node/lib/index.d.ts.map +1 -0
- package/dist/node/lib/index.js +27 -0
- package/dist/node/lib/index.js.map +1 -0
- package/dist/node/lib/index.mjs +4 -0
- package/dist/node/lib/index.mjs.map +1 -0
- package/dist/node/lib/pricesFromCoingecko.d.mts +3 -0
- package/dist/node/lib/pricesFromCoingecko.d.mts.map +1 -0
- package/dist/node/lib/pricesFromCoingecko.d.ts +3 -0
- package/dist/node/lib/pricesFromCoingecko.d.ts.map +1 -0
- package/dist/node/lib/pricesFromCoingecko.js +39 -0
- package/dist/node/lib/pricesFromCoingecko.js.map +1 -0
- package/dist/node/lib/pricesFromCoingecko.mjs +15 -0
- package/dist/node/lib/pricesFromCoingecko.mjs.map +1 -0
- package/package.json +30 -27
- package/dist/Config.d.mts.map +0 -1
- package/dist/Config.d.ts.map +0 -1
- package/dist/Plugin.d.mts.map +0 -1
- package/dist/Plugin.d.ts.map +0 -1
- package/dist/Schema.d.mts.map +0 -1
- package/dist/Schema.d.ts.map +0 -1
- package/dist/Witness.d.mts.map +0 -1
- package/dist/Witness.d.ts.map +0 -1
- package/dist/docs.json +0 -22794
- package/dist/index.d.mts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/lib/coinGeckoCoinToAssetMap.d.mts.map +0 -1
- package/dist/lib/coinGeckoCoinToAssetMap.d.ts.map +0 -1
- package/dist/lib/defaults.d.mts.map +0 -1
- package/dist/lib/defaults.d.ts.map +0 -1
- package/dist/lib/index.d.mts.map +0 -1
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/pricesFromCoingecko.d.mts.map +0 -1
- package/dist/lib/pricesFromCoingecko.d.ts.map +0 -1
- /package/dist/{Config.d.mts → browser/Config.d.mts} +0 -0
- /package/dist/{Config.d.ts → browser/Config.d.ts} +0 -0
- /package/dist/{Plugin.d.mts → browser/Plugin.d.mts} +0 -0
- /package/dist/{Plugin.d.ts → browser/Plugin.d.ts} +0 -0
- /package/dist/{Schema.d.mts → browser/Schema.d.mts} +0 -0
- /package/dist/{Schema.d.ts → browser/Schema.d.ts} +0 -0
- /package/dist/{Witness.d.mts → browser/Witness.d.mts} +0 -0
- /package/dist/{Witness.d.ts → browser/Witness.d.ts} +0 -0
- /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
- /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
- /package/dist/{lib → browser/lib}/coinGeckoCoinToAssetMap.d.mts +0 -0
- /package/dist/{lib → browser/lib}/coinGeckoCoinToAssetMap.d.ts +0 -0
- /package/dist/{lib → browser/lib}/defaults.d.mts +0 -0
- /package/dist/{lib → browser/lib}/defaults.d.ts +0 -0
- /package/dist/{lib → browser/lib}/index.d.mts +0 -0
- /package/dist/{lib → browser/lib}/index.d.ts +0 -0
- /package/dist/{lib → browser/lib}/pricesFromCoingecko.d.mts +0 -0
- /package/dist/{lib → browser/lib}/pricesFromCoingecko.d.ts +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Schema_exports = {};
|
|
20
|
+
__export(Schema_exports, {
|
|
21
|
+
CoingeckoCryptoMarketWitnessConfigSchema: () => CoingeckoCryptoMarketWitnessConfigSchema
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Schema_exports);
|
|
24
|
+
const CoingeckoCryptoMarketWitnessConfigSchema = "network.xyo.crypto.market.coingecko.witness.config";
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
CoingeckoCryptoMarketWitnessConfigSchema
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=Schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Schema.ts"],"sourcesContent":["export type CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\nexport const CoingeckoCryptoMarketWitnessConfigSchema: CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,MAAM,2CAAqF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Schema.ts"],"sourcesContent":["export type CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\nexport const CoingeckoCryptoMarketWitnessConfigSchema: CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\n"],"mappings":"AACO,MAAM,2CAAqF;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module';
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { AbstractWitness, WitnessParams } from '@xyo-network/witness';
|
|
4
|
+
import { CoingeckoCryptoMarketWitnessConfig } from './Config';
|
|
5
|
+
export type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>;
|
|
6
|
+
export declare class CoingeckoCryptoMarketWitness<TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams> extends AbstractWitness<TParams> {
|
|
7
|
+
static configSchemas: "network.xyo.crypto.market.coingecko.witness.config"[];
|
|
8
|
+
protected observeHandler(): Promise<Payload[]>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAErE,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAA;AAI7D,MAAM,MAAM,kCAAkC,GAAG,aAAa,CAAC,eAAe,CAAC,kCAAkC,CAAC,CAAC,CAAA;AAEnH,qBAAa,4BAA4B,CACvC,OAAO,SAAS,kCAAkC,GAAG,kCAAkC,CACvF,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,OAAgB,aAAa,yDAA6C;cAEjD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAU9D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module';
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { AbstractWitness, WitnessParams } from '@xyo-network/witness';
|
|
4
|
+
import { CoingeckoCryptoMarketWitnessConfig } from './Config';
|
|
5
|
+
export type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>;
|
|
6
|
+
export declare class CoingeckoCryptoMarketWitness<TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams> extends AbstractWitness<TParams> {
|
|
7
|
+
static configSchemas: "network.xyo.crypto.market.coingecko.witness.config"[];
|
|
8
|
+
protected observeHandler(): Promise<Payload[]>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAErE,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAA;AAI7D,MAAM,MAAM,kCAAkC,GAAG,aAAa,CAAC,eAAe,CAAC,kCAAkC,CAAC,CAAC,CAAA;AAEnH,qBAAa,4BAA4B,CACvC,OAAO,SAAS,kCAAkC,GAAG,kCAAkC,CACvF,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,OAAgB,aAAa,yDAA6C;cAEjD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAU9D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Witness_exports = {};
|
|
20
|
+
__export(Witness_exports, {
|
|
21
|
+
CoingeckoCryptoMarketWitness: () => CoingeckoCryptoMarketWitness
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Witness_exports);
|
|
24
|
+
var import_coingecko_crypto_market_payload_plugin = require("@xyo-network/coingecko-crypto-market-payload-plugin");
|
|
25
|
+
var import_witness = require("@xyo-network/witness");
|
|
26
|
+
var import_lib = require("./lib");
|
|
27
|
+
var import_Schema = require("./Schema");
|
|
28
|
+
class CoingeckoCryptoMarketWitness extends import_witness.AbstractWitness {
|
|
29
|
+
static configSchemas = [import_Schema.CoingeckoCryptoMarketWitnessConfigSchema];
|
|
30
|
+
async observeHandler() {
|
|
31
|
+
const assets = await (0, import_lib.pricesFromCoingecko)(this.config?.coins ?? [], this.config?.currencies ?? []);
|
|
32
|
+
const payload = {
|
|
33
|
+
assets,
|
|
34
|
+
schema: import_coingecko_crypto_market_payload_plugin.CoingeckoCryptoMarketSchema,
|
|
35
|
+
timestamp: Date.now()
|
|
36
|
+
};
|
|
37
|
+
return [payload];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
CoingeckoCryptoMarketWitness
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=Witness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { CoingeckoCryptoMarketPayload, CoingeckoCryptoMarketSchema } from '@xyo-network/coingecko-crypto-market-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness, WitnessParams } from '@xyo-network/witness'\n\nimport { CoingeckoCryptoMarketWitnessConfig } from './Config'\nimport { pricesFromCoingecko } from './lib'\nimport { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema'\n\nexport type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>\n\nexport class CoingeckoCryptoMarketWitness<\n TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [CoingeckoCryptoMarketWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const assets: CoingeckoCryptoMarketPayload['assets'] = await pricesFromCoingecko(this.config?.coins ?? [], this.config?.currencies ?? [])\n const payload: CoingeckoCryptoMarketPayload = {\n assets,\n schema: CoingeckoCryptoMarketSchema,\n timestamp: Date.now(),\n }\n\n return [payload]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oDAA0E;AAG1E,qBAA+C;AAG/C,iBAAoC;AACpC,oBAAyD;AAIlD,MAAM,qCAEH,+BAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,sDAAwC;AAAA,EAEzE,MAAyB,iBAAqC;AAC5D,UAAM,SAAiD,UAAM,gCAAoB,KAAK,QAAQ,SAAS,CAAC,GAAG,KAAK,QAAQ,cAAc,CAAC,CAAC;AACxI,UAAM,UAAwC;AAAA,MAC5C;AAAA,MACA,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AAEA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CoingeckoCryptoMarketSchema } from "@xyo-network/coingecko-crypto-market-payload-plugin";
|
|
2
|
+
import { AbstractWitness } from "@xyo-network/witness";
|
|
3
|
+
import { pricesFromCoingecko } from "./lib";
|
|
4
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from "./Schema";
|
|
5
|
+
class CoingeckoCryptoMarketWitness extends AbstractWitness {
|
|
6
|
+
static configSchemas = [CoingeckoCryptoMarketWitnessConfigSchema];
|
|
7
|
+
async observeHandler() {
|
|
8
|
+
const assets = await pricesFromCoingecko(this.config?.coins ?? [], this.config?.currencies ?? []);
|
|
9
|
+
const payload = {
|
|
10
|
+
assets,
|
|
11
|
+
schema: CoingeckoCryptoMarketSchema,
|
|
12
|
+
timestamp: Date.now()
|
|
13
|
+
};
|
|
14
|
+
return [payload];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
CoingeckoCryptoMarketWitness
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Witness.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { CoingeckoCryptoMarketPayload, CoingeckoCryptoMarketSchema } from '@xyo-network/coingecko-crypto-market-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness, WitnessParams } from '@xyo-network/witness'\n\nimport { CoingeckoCryptoMarketWitnessConfig } from './Config'\nimport { pricesFromCoingecko } from './lib'\nimport { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema'\n\nexport type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>\n\nexport class CoingeckoCryptoMarketWitness<\n TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [CoingeckoCryptoMarketWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const assets: CoingeckoCryptoMarketPayload['assets'] = await pricesFromCoingecko(this.config?.coins ?? [], this.config?.currencies ?? [])\n const payload: CoingeckoCryptoMarketPayload = {\n assets,\n schema: CoingeckoCryptoMarketSchema,\n timestamp: Date.now(),\n }\n\n return [payload]\n }\n}\n"],"mappings":"AAAA,SAAuC,mCAAmC;AAG1E,SAAS,uBAAsC;AAG/C,SAAS,2BAA2B;AACpC,SAAS,gDAAgD;AAIlD,MAAM,qCAEH,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,wCAAwC;AAAA,EAEzE,MAAyB,iBAAqC;AAC5D,UAAM,SAAiD,MAAM,oBAAoB,KAAK,QAAQ,SAAS,CAAC,GAAG,KAAK,QAAQ,cAAc,CAAC,CAAC;AACxI,UAAM,UAAwC;AAAA,MAC5C;AAAA,MACA,QAAQ;AAAA,MACR,WAAW,KAAK,IAAI;AAAA,IACtB;AAEA,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoingeckoCryptoMarketPlugin } from './Plugin';
|
|
2
|
+
export * from './Config';
|
|
3
|
+
export * from './lib';
|
|
4
|
+
export * from './Schema';
|
|
5
|
+
export * from './Witness';
|
|
6
|
+
export { CoingeckoCryptoMarketPlugin };
|
|
7
|
+
export default CoingeckoCryptoMarketPlugin;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAEtD,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,2BAA2B,EAAE,CAAA;AAGtC,eAAe,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CoingeckoCryptoMarketPlugin } from './Plugin';
|
|
2
|
+
export * from './Config';
|
|
3
|
+
export * from './lib';
|
|
4
|
+
export * from './Schema';
|
|
5
|
+
export * from './Witness';
|
|
6
|
+
export { CoingeckoCryptoMarketPlugin };
|
|
7
|
+
export default CoingeckoCryptoMarketPlugin;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAEtD,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,2BAA2B,EAAE,CAAA;AAGtC,eAAe,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
CoingeckoCryptoMarketPlugin: () => import_Plugin.CoingeckoCryptoMarketPlugin,
|
|
23
|
+
default: () => src_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var import_Plugin = require("./Plugin");
|
|
27
|
+
__reExport(src_exports, require("./Config"), module.exports);
|
|
28
|
+
__reExport(src_exports, require("./lib"), module.exports);
|
|
29
|
+
__reExport(src_exports, require("./Schema"), module.exports);
|
|
30
|
+
__reExport(src_exports, require("./Witness"), module.exports);
|
|
31
|
+
var src_default = import_Plugin.CoingeckoCryptoMarketPlugin;
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
CoingeckoCryptoMarketPlugin,
|
|
35
|
+
...require("./Config"),
|
|
36
|
+
...require("./lib"),
|
|
37
|
+
...require("./Schema"),
|
|
38
|
+
...require("./Witness")
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { CoingeckoCryptoMarketPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './lib'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { CoingeckoCryptoMarketPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default CoingeckoCryptoMarketPlugin\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA4C;AAE5C,wBAAc,qBAFd;AAGA,wBAAc,kBAHd;AAIA,wBAAc,qBAJd;AAKA,wBAAc,sBALd;AAUA,IAAO,cAAQ;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CoingeckoCryptoMarketPlugin } from "./Plugin";
|
|
2
|
+
export * from "./Config";
|
|
3
|
+
export * from "./lib";
|
|
4
|
+
export * from "./Schema";
|
|
5
|
+
export * from "./Witness";
|
|
6
|
+
var src_default = CoingeckoCryptoMarketPlugin;
|
|
7
|
+
export {
|
|
8
|
+
CoingeckoCryptoMarketPlugin,
|
|
9
|
+
src_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { CoingeckoCryptoMarketPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './lib'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { CoingeckoCryptoMarketPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default CoingeckoCryptoMarketPlugin\n"],"mappings":"AAAA,SAAS,mCAAmC;AAE5C,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,IAAO,cAAQ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinGeckoCoinToAssetMap.d.ts","sourceRoot":"","sources":["../../../src/lib/coinGeckoCoinToAssetMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AAEjF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAc/D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinGeckoCoinToAssetMap.d.ts","sourceRoot":"","sources":["../../../src/lib/coinGeckoCoinToAssetMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AAEjF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAc/D,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var coinGeckoCoinToAssetMap_exports = {};
|
|
20
|
+
__export(coinGeckoCoinToAssetMap_exports, {
|
|
21
|
+
coingeckoCoinToAssetMap: () => coingeckoCoinToAssetMap
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(coinGeckoCoinToAssetMap_exports);
|
|
24
|
+
const coingeckoCoinToAssetMap = {
|
|
25
|
+
"binance-usd": "busd",
|
|
26
|
+
bitcoin: "btc",
|
|
27
|
+
bnb: "bnb",
|
|
28
|
+
cardano: "ada",
|
|
29
|
+
dogecoin: "doge",
|
|
30
|
+
ethereum: "eth",
|
|
31
|
+
polkadot: "dot",
|
|
32
|
+
solana: "sol",
|
|
33
|
+
tether: "usdt",
|
|
34
|
+
"usd-coin": "usdc",
|
|
35
|
+
"wrapped-bitcoin": "wbtc",
|
|
36
|
+
xrp: "xrp",
|
|
37
|
+
"xyo-network": "xyo"
|
|
38
|
+
};
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
coingeckoCoinToAssetMap
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=coinGeckoCoinToAssetMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/coinGeckoCoinToAssetMap.ts"],"sourcesContent":["import { AssetSymbol } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nexport const coingeckoCoinToAssetMap: Record<string, AssetSymbol> = {\n 'binance-usd': 'busd',\n bitcoin: 'btc',\n bnb: 'bnb',\n cardano: 'ada',\n dogecoin: 'doge',\n ethereum: 'eth',\n polkadot: 'dot',\n solana: 'sol',\n tether: 'usdt',\n 'usd-coin': 'usdc',\n 'wrapped-bitcoin': 'wbtc',\n xrp: 'xrp',\n 'xyo-network': 'xyo',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,0BAAuD;AAAA,EAClE,eAAe;AAAA,EACf,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,KAAK;AAAA,EACL,eAAe;AACjB;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const coingeckoCoinToAssetMap = {
|
|
2
|
+
"binance-usd": "busd",
|
|
3
|
+
bitcoin: "btc",
|
|
4
|
+
bnb: "bnb",
|
|
5
|
+
cardano: "ada",
|
|
6
|
+
dogecoin: "doge",
|
|
7
|
+
ethereum: "eth",
|
|
8
|
+
polkadot: "dot",
|
|
9
|
+
solana: "sol",
|
|
10
|
+
tether: "usdt",
|
|
11
|
+
"usd-coin": "usdc",
|
|
12
|
+
"wrapped-bitcoin": "wbtc",
|
|
13
|
+
xrp: "xrp",
|
|
14
|
+
"xyo-network": "xyo"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
coingeckoCoinToAssetMap
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=coinGeckoCoinToAssetMap.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/coinGeckoCoinToAssetMap.ts"],"sourcesContent":["import { AssetSymbol } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nexport const coingeckoCoinToAssetMap: Record<string, AssetSymbol> = {\n 'binance-usd': 'busd',\n bitcoin: 'btc',\n bnb: 'bnb',\n cardano: 'ada',\n dogecoin: 'doge',\n ethereum: 'eth',\n polkadot: 'dot',\n solana: 'sol',\n tether: 'usdt',\n 'usd-coin': 'usdc',\n 'wrapped-bitcoin': 'wbtc',\n xrp: 'xrp',\n 'xyo-network': 'xyo',\n}\n"],"mappings":"AAEO,MAAM,0BAAuD;AAAA,EAClE,eAAe;AAAA,EACf,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AAAA,EACT,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,KAAK;AAAA,EACL,eAAe;AACjB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/lib/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AAEjF,eAAO,MAAM,YAAY,EAAE,WAAW,EAcrC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAAiF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/lib/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AAEjF,eAAO,MAAM,YAAY,EAAE,WAAW,EAcrC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAAiF,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var defaults_exports = {};
|
|
20
|
+
__export(defaults_exports, {
|
|
21
|
+
defaultCoins: () => defaultCoins,
|
|
22
|
+
defaultCurrencies: () => defaultCurrencies
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(defaults_exports);
|
|
25
|
+
const defaultCoins = [
|
|
26
|
+
{ name: "bitcoin" },
|
|
27
|
+
{ name: "binance-usd" },
|
|
28
|
+
{ name: "bnb" },
|
|
29
|
+
{ name: "cardano" },
|
|
30
|
+
{ name: "dogecoin" },
|
|
31
|
+
{ name: "ethereum" },
|
|
32
|
+
{ name: "polkadot" },
|
|
33
|
+
{ name: "solana" },
|
|
34
|
+
{ name: "tether" },
|
|
35
|
+
{ name: "usd-coin" },
|
|
36
|
+
{ name: "wrapped-bitcoin" },
|
|
37
|
+
{ name: "xrp" },
|
|
38
|
+
{ name: "xyo-network" }
|
|
39
|
+
];
|
|
40
|
+
const defaultCurrencies = [{ symbol: "usd" }, { symbol: "eur" }, { symbol: "btc" }, { symbol: "eth" }];
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
defaultCoins,
|
|
44
|
+
defaultCurrencies
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/defaults.ts"],"sourcesContent":["import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nexport const defaultCoins: CryptoAsset[] = [\n { name: 'bitcoin' },\n { name: 'binance-usd' },\n { name: 'bnb' },\n { name: 'cardano' },\n { name: 'dogecoin' },\n { name: 'ethereum' },\n { name: 'polkadot' },\n { name: 'solana' },\n { name: 'tether' },\n { name: 'usd-coin' },\n { name: 'wrapped-bitcoin' },\n { name: 'xrp' },\n { name: 'xyo-network' },\n]\n\nexport const defaultCurrencies: CryptoAsset[] = [{ symbol: 'usd' }, { symbol: 'eur' }, { symbol: 'btc' }, { symbol: 'eth' }]\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,eAA8B;AAAA,EACzC,EAAE,MAAM,UAAU;AAAA,EAClB,EAAE,MAAM,cAAc;AAAA,EACtB,EAAE,MAAM,MAAM;AAAA,EACd,EAAE,MAAM,UAAU;AAAA,EAClB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,SAAS;AAAA,EACjB,EAAE,MAAM,SAAS;AAAA,EACjB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,kBAAkB;AAAA,EAC1B,EAAE,MAAM,MAAM;AAAA,EACd,EAAE,MAAM,cAAc;AACxB;AAEO,MAAM,oBAAmC,CAAC,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,CAAC;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const defaultCoins = [
|
|
2
|
+
{ name: "bitcoin" },
|
|
3
|
+
{ name: "binance-usd" },
|
|
4
|
+
{ name: "bnb" },
|
|
5
|
+
{ name: "cardano" },
|
|
6
|
+
{ name: "dogecoin" },
|
|
7
|
+
{ name: "ethereum" },
|
|
8
|
+
{ name: "polkadot" },
|
|
9
|
+
{ name: "solana" },
|
|
10
|
+
{ name: "tether" },
|
|
11
|
+
{ name: "usd-coin" },
|
|
12
|
+
{ name: "wrapped-bitcoin" },
|
|
13
|
+
{ name: "xrp" },
|
|
14
|
+
{ name: "xyo-network" }
|
|
15
|
+
];
|
|
16
|
+
const defaultCurrencies = [{ symbol: "usd" }, { symbol: "eur" }, { symbol: "btc" }, { symbol: "eth" }];
|
|
17
|
+
export {
|
|
18
|
+
defaultCoins,
|
|
19
|
+
defaultCurrencies
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=defaults.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/defaults.ts"],"sourcesContent":["import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nexport const defaultCoins: CryptoAsset[] = [\n { name: 'bitcoin' },\n { name: 'binance-usd' },\n { name: 'bnb' },\n { name: 'cardano' },\n { name: 'dogecoin' },\n { name: 'ethereum' },\n { name: 'polkadot' },\n { name: 'solana' },\n { name: 'tether' },\n { name: 'usd-coin' },\n { name: 'wrapped-bitcoin' },\n { name: 'xrp' },\n { name: 'xyo-network' },\n]\n\nexport const defaultCurrencies: CryptoAsset[] = [{ symbol: 'usd' }, { symbol: 'eur' }, { symbol: 'btc' }, { symbol: 'eth' }]\n"],"mappings":"AAEO,MAAM,eAA8B;AAAA,EACzC,EAAE,MAAM,UAAU;AAAA,EAClB,EAAE,MAAM,cAAc;AAAA,EACtB,EAAE,MAAM,MAAM;AAAA,EACd,EAAE,MAAM,UAAU;AAAA,EAClB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,SAAS;AAAA,EACjB,EAAE,MAAM,SAAS;AAAA,EACjB,EAAE,MAAM,WAAW;AAAA,EACnB,EAAE,MAAM,kBAAkB;AAAA,EAC1B,EAAE,MAAM,MAAM;AAAA,EACd,EAAE,MAAM,cAAc;AACxB;AAEO,MAAM,oBAAmC,CAAC,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,MAAM,CAAC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var lib_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(lib_exports);
|
|
18
|
+
__reExport(lib_exports, require("./coinGeckoCoinToAssetMap"), module.exports);
|
|
19
|
+
__reExport(lib_exports, require("./defaults"), module.exports);
|
|
20
|
+
__reExport(lib_exports, require("./pricesFromCoingecko"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("./coinGeckoCoinToAssetMap"),
|
|
24
|
+
...require("./defaults"),
|
|
25
|
+
...require("./pricesFromCoingecko")
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './coinGeckoCoinToAssetMap'\nexport * from './defaults'\nexport * from './pricesFromCoingecko'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,sCAAd;AACA,wBAAc,uBADd;AAEA,wBAAc,kCAFd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './coinGeckoCoinToAssetMap'\nexport * from './defaults'\nexport * from './pricesFromCoingecko'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
|
+
export declare const pricesFromCoingecko: (coins: CryptoAsset[], currencies: CryptoAsset[]) => Promise<Partial<Record<string, Partial<Record<string, number> | undefined>>>>;
|
|
3
|
+
//# sourceMappingURL=pricesFromCoingecko.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricesFromCoingecko.d.ts","sourceRoot":"","sources":["../../../src/lib/pricesFromCoingecko.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,WAAW,EAAqB,MAAM,qDAAqD,CAAA;AAOjH,eAAO,MAAM,mBAAmB,UAAiB,WAAW,EAAE,cAAc,WAAW,EAAE,kFAUxF,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
|
+
export declare const pricesFromCoingecko: (coins: CryptoAsset[], currencies: CryptoAsset[]) => Promise<Partial<Record<string, Partial<Record<string, number> | undefined>>>>;
|
|
3
|
+
//# sourceMappingURL=pricesFromCoingecko.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricesFromCoingecko.d.ts","sourceRoot":"","sources":["../../../src/lib/pricesFromCoingecko.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,WAAW,EAAqB,MAAM,qDAAqD,CAAA;AAOjH,eAAO,MAAM,mBAAmB,UAAiB,WAAW,EAAE,cAAc,WAAW,EAAE,kFAUxF,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var pricesFromCoingecko_exports = {};
|
|
20
|
+
__export(pricesFromCoingecko_exports, {
|
|
21
|
+
pricesFromCoingecko: () => pricesFromCoingecko
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(pricesFromCoingecko_exports);
|
|
24
|
+
var import_axios = require("@xyo-network/axios");
|
|
25
|
+
var import_coinGeckoCoinToAssetMap = require("./coinGeckoCoinToAssetMap");
|
|
26
|
+
const pricesFromCoingecko = async (coins, currencies) => {
|
|
27
|
+
const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coins.map(({ name }) => name).join(",")}&vs_currencies=${currencies.map(({ symbol }) => symbol).join(",")}`;
|
|
28
|
+
const coinGeckoSimplePrices = (await import_axios.axios.get(url)).data;
|
|
29
|
+
const assets = {};
|
|
30
|
+
Object.entries(coinGeckoSimplePrices).forEach(([key, value]) => {
|
|
31
|
+
assets[import_coinGeckoCoinToAssetMap.coingeckoCoinToAssetMap[key]] = value;
|
|
32
|
+
});
|
|
33
|
+
return assets;
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
pricesFromCoingecko
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=pricesFromCoingecko.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/pricesFromCoingecko.ts"],"sourcesContent":["import { axios } from '@xyo-network/axios'\nimport { AssetSymbol, CryptoAsset, CryptoAssetPrices } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nimport { coingeckoCoinToAssetMap } from './coinGeckoCoinToAssetMap'\n\ntype CoinGeckoSimplePrice = Partial<Record<AssetSymbol, number>>\ntype CoinGeckoSimplePrices = Record<string, CoinGeckoSimplePrice>\n\nexport const pricesFromCoingecko = async (coins: CryptoAsset[], currencies: CryptoAsset[]) => {\n const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coins.map(({ name }) => name).join(',')}&vs_currencies=${currencies\n .map(({ symbol }) => symbol)\n .join(',')}`\n const coinGeckoSimplePrices = (await axios.get<CoinGeckoSimplePrices>(url)).data\n const assets: CryptoAssetPrices = {}\n Object.entries(coinGeckoSimplePrices).forEach(([key, value]) => {\n assets[coingeckoCoinToAssetMap[key]] = value\n })\n return assets\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAGtB,qCAAwC;AAKjC,MAAM,sBAAsB,OAAO,OAAsB,eAA8B;AAC5F,QAAM,MAAM,qDAAqD,MAAM,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI,EAAE,KAAK,GAAG,CAAC,kBAAkB,WACvH,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM,EAC1B,KAAK,GAAG,CAAC;AACZ,QAAM,yBAAyB,MAAM,mBAAM,IAA2B,GAAG,GAAG;AAC5E,QAAM,SAA4B,CAAC;AACnC,SAAO,QAAQ,qBAAqB,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC9D,WAAO,uDAAwB,GAAG,CAAC,IAAI;AAAA,EACzC,CAAC;AACD,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { axios } from "@xyo-network/axios";
|
|
2
|
+
import { coingeckoCoinToAssetMap } from "./coinGeckoCoinToAssetMap";
|
|
3
|
+
const pricesFromCoingecko = async (coins, currencies) => {
|
|
4
|
+
const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coins.map(({ name }) => name).join(",")}&vs_currencies=${currencies.map(({ symbol }) => symbol).join(",")}`;
|
|
5
|
+
const coinGeckoSimplePrices = (await axios.get(url)).data;
|
|
6
|
+
const assets = {};
|
|
7
|
+
Object.entries(coinGeckoSimplePrices).forEach(([key, value]) => {
|
|
8
|
+
assets[coingeckoCoinToAssetMap[key]] = value;
|
|
9
|
+
});
|
|
10
|
+
return assets;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
pricesFromCoingecko
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=pricesFromCoingecko.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/pricesFromCoingecko.ts"],"sourcesContent":["import { axios } from '@xyo-network/axios'\nimport { AssetSymbol, CryptoAsset, CryptoAssetPrices } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nimport { coingeckoCoinToAssetMap } from './coinGeckoCoinToAssetMap'\n\ntype CoinGeckoSimplePrice = Partial<Record<AssetSymbol, number>>\ntype CoinGeckoSimplePrices = Record<string, CoinGeckoSimplePrice>\n\nexport const pricesFromCoingecko = async (coins: CryptoAsset[], currencies: CryptoAsset[]) => {\n const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coins.map(({ name }) => name).join(',')}&vs_currencies=${currencies\n .map(({ symbol }) => symbol)\n .join(',')}`\n const coinGeckoSimplePrices = (await axios.get<CoinGeckoSimplePrices>(url)).data\n const assets: CryptoAssetPrices = {}\n Object.entries(coinGeckoSimplePrices).forEach(([key, value]) => {\n assets[coingeckoCoinToAssetMap[key]] = value\n })\n return assets\n}\n"],"mappings":"AAAA,SAAS,aAAa;AAGtB,SAAS,+BAA+B;AAKjC,MAAM,sBAAsB,OAAO,OAAsB,eAA8B;AAC5F,QAAM,MAAM,qDAAqD,MAAM,IAAI,CAAC,EAAE,KAAK,MAAM,IAAI,EAAE,KAAK,GAAG,CAAC,kBAAkB,WACvH,IAAI,CAAC,EAAE,OAAO,MAAM,MAAM,EAC1B,KAAK,GAAG,CAAC;AACZ,QAAM,yBAAyB,MAAM,MAAM,IAA2B,GAAG,GAAG;AAC5E,QAAM,SAA4B,CAAC;AACnC,SAAO,QAAQ,qBAAqB,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC9D,WAAO,wBAAwB,GAAG,CAAC,IAAI;AAAA,EACzC,CAAC;AACD,SAAO;AACT;","names":[]}
|