@xyo-network/coingecko-crypto-market-plugin 2.99.3 → 2.99.5
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.d.cts +1 -1
- package/dist/browser/Config.d.mts +1 -1
- package/dist/browser/Config.d.ts +1 -1
- package/dist/browser/Plugin.d.cts +2 -2
- package/dist/browser/Plugin.d.mts +2 -2
- package/dist/browser/Plugin.d.ts +2 -2
- package/dist/browser/Witness.d.cts +1 -1
- package/dist/browser/Witness.d.mts +1 -1
- package/dist/browser/Witness.d.ts +1 -1
- package/dist/browser/index.cjs +86 -36
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +5 -5
- package/dist/browser/index.d.mts +5 -5
- package/dist/browser/index.d.ts +5 -5
- package/dist/browser/{index.js → index.mjs} +89 -37
- package/dist/browser/index.mjs.map +1 -0
- package/dist/browser/lib/index.d.cts +3 -3
- package/dist/browser/lib/index.d.mts +3 -3
- package/dist/browser/lib/index.d.ts +3 -3
- package/dist/neutral/Config.d.cts +1 -1
- package/dist/neutral/Config.d.mts +1 -1
- package/dist/neutral/Config.d.ts +1 -1
- package/dist/neutral/Plugin.d.cts +2 -2
- package/dist/neutral/Plugin.d.mts +2 -2
- package/dist/neutral/Plugin.d.ts +2 -2
- package/dist/neutral/Witness.d.cts +1 -1
- package/dist/neutral/Witness.d.mts +1 -1
- package/dist/neutral/Witness.d.ts +1 -1
- package/dist/neutral/index.cjs +86 -36
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +5 -5
- package/dist/neutral/index.d.mts +5 -5
- package/dist/neutral/index.d.ts +5 -5
- package/dist/neutral/{index.js → index.mjs} +89 -37
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/neutral/lib/index.d.cts +3 -3
- package/dist/neutral/lib/index.d.mts +3 -3
- package/dist/neutral/lib/index.d.ts +3 -3
- package/dist/node/Config.d.cts +1 -1
- package/dist/node/Config.d.mts +1 -1
- package/dist/node/Config.d.ts +1 -1
- package/dist/node/Plugin.d.cts +2 -2
- package/dist/node/Plugin.d.mts +2 -2
- package/dist/node/Plugin.d.ts +2 -2
- package/dist/node/Witness.d.cts +1 -1
- package/dist/node/Witness.d.mts +1 -1
- package/dist/node/Witness.d.ts +1 -1
- package/dist/node/index.cjs +92 -38
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +5 -5
- package/dist/node/index.d.mts +5 -5
- package/dist/node/index.d.ts +5 -5
- package/dist/node/index.mjs +152 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/index.d.cts +3 -3
- package/dist/node/lib/index.d.mts +3 -3
- package/dist/node/lib/index.d.ts +3 -3
- package/package.json +15 -16
- package/src/Config.ts +1 -1
- package/src/Plugin.ts +1 -1
- package/src/Witness.ts +3 -3
- package/src/index.ts +5 -5
- package/src/lib/coinGeckoCoinToAssetMap.ts +9 -9
- package/src/lib/index.ts +3 -3
- package/src/lib/pricesFromCoingecko.ts +1 -1
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/index.js +0 -96
- package/dist/node/index.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
2
|
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts';
|
|
4
4
|
export type CoingeckoCryptoMarketWitnessConfig = WitnessConfig<{
|
|
5
5
|
coins?: CryptoAsset[];
|
|
6
6
|
currencies?: CryptoAsset[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
2
|
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts';
|
|
4
4
|
export type CoingeckoCryptoMarketWitnessConfig = WitnessConfig<{
|
|
5
5
|
coins?: CryptoAsset[];
|
|
6
6
|
currencies?: CryptoAsset[];
|
package/dist/browser/Config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
2
|
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts';
|
|
4
4
|
export type CoingeckoCryptoMarketWitnessConfig = WitnessConfig<{
|
|
5
5
|
coins?: CryptoAsset[];
|
|
6
6
|
currencies?: CryptoAsset[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoingeckoCryptoMarketWitness } from './Witness.
|
|
1
|
+
import { CoingeckoCryptoMarketWitness } from './Witness.ts';
|
|
2
2
|
export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CoingeckoCryptoMarketWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -9,7 +9,7 @@ export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/pay
|
|
|
9
9
|
} & {
|
|
10
10
|
coins?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
11
11
|
currencies?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
12
|
-
schema: import("./Schema.
|
|
12
|
+
schema: import("./Schema.ts").CoingeckoCryptoMarketWitnessConfigSchema;
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: "network.xyo.crypto.market.coingecko.witness.config";
|
|
15
15
|
}, "schema"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoingeckoCryptoMarketWitness } from './Witness.
|
|
1
|
+
import { CoingeckoCryptoMarketWitness } from './Witness.ts';
|
|
2
2
|
export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CoingeckoCryptoMarketWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -9,7 +9,7 @@ export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/pay
|
|
|
9
9
|
} & {
|
|
10
10
|
coins?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
11
11
|
currencies?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
12
|
-
schema: import("./Schema.
|
|
12
|
+
schema: import("./Schema.ts").CoingeckoCryptoMarketWitnessConfigSchema;
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: "network.xyo.crypto.market.coingecko.witness.config";
|
|
15
15
|
}, "schema"> & {
|
package/dist/browser/Plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoingeckoCryptoMarketWitness } from './Witness.
|
|
1
|
+
import { CoingeckoCryptoMarketWitness } from './Witness.ts';
|
|
2
2
|
export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CoingeckoCryptoMarketWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -9,7 +9,7 @@ export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/pay
|
|
|
9
9
|
} & {
|
|
10
10
|
coins?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
11
11
|
currencies?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
12
|
-
schema: import("./Schema.
|
|
12
|
+
schema: import("./Schema.ts").CoingeckoCryptoMarketWitnessConfigSchema;
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: "network.xyo.crypto.market.coingecko.witness.config";
|
|
15
15
|
}, "schema"> & {
|
|
@@ -2,7 +2,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
|
-
import { CoingeckoCryptoMarketWitnessConfig } from './Config.
|
|
5
|
+
import { CoingeckoCryptoMarketWitnessConfig } from './Config.ts';
|
|
6
6
|
export type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>;
|
|
7
7
|
export declare class CoingeckoCryptoMarketWitness<TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams> extends AbstractWitness<TParams> {
|
|
8
8
|
static readonly configSchemas: Schema[];
|
|
@@ -2,7 +2,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
|
-
import { CoingeckoCryptoMarketWitnessConfig } from './Config.
|
|
5
|
+
import { CoingeckoCryptoMarketWitnessConfig } from './Config.ts';
|
|
6
6
|
export type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>;
|
|
7
7
|
export declare class CoingeckoCryptoMarketWitness<TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams> extends AbstractWitness<TParams> {
|
|
8
8
|
static readonly configSchemas: Schema[];
|
|
@@ -2,7 +2,7 @@ import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import { WitnessParams } from '@xyo-network/witness-model';
|
|
5
|
-
import { CoingeckoCryptoMarketWitnessConfig } from './Config.
|
|
5
|
+
import { CoingeckoCryptoMarketWitnessConfig } from './Config.ts';
|
|
6
6
|
export type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>;
|
|
7
7
|
export declare class CoingeckoCryptoMarketWitness<TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams> extends AbstractWitness<TParams> {
|
|
8
8
|
static readonly configSchemas: Schema[];
|
package/dist/browser/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -34,41 +35,80 @@ module.exports = __toCommonJS(src_exports);
|
|
|
34
35
|
// src/lib/coinGeckoCoinToAssetMap.ts
|
|
35
36
|
var coingeckoCoinToAssetMap = {
|
|
36
37
|
"binance-usd": "busd",
|
|
37
|
-
bitcoin: "btc",
|
|
38
|
-
bnb: "bnb",
|
|
39
|
-
cardano: "ada",
|
|
40
|
-
dogecoin: "doge",
|
|
41
|
-
ethereum: "eth",
|
|
42
|
-
polkadot: "dot",
|
|
43
|
-
solana: "sol",
|
|
44
|
-
tether: "usdt",
|
|
38
|
+
"bitcoin": "btc",
|
|
39
|
+
"bnb": "bnb",
|
|
40
|
+
"cardano": "ada",
|
|
41
|
+
"dogecoin": "doge",
|
|
42
|
+
"ethereum": "eth",
|
|
43
|
+
"polkadot": "dot",
|
|
44
|
+
"solana": "sol",
|
|
45
|
+
"tether": "usdt",
|
|
45
46
|
"usd-coin": "usdc",
|
|
46
47
|
"wrapped-bitcoin": "wbtc",
|
|
47
|
-
xrp: "xrp",
|
|
48
|
+
"xrp": "xrp",
|
|
48
49
|
"xyo-network": "xyo"
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
// src/lib/defaults.ts
|
|
52
53
|
var defaultCoins = [
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
54
|
+
{
|
|
55
|
+
name: "bitcoin"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "binance-usd"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "bnb"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "cardano"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "dogecoin"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "ethereum"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "polkadot"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "solana"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "tether"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "usd-coin"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "wrapped-bitcoin"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "xrp"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "xyo-network"
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
var defaultCurrencies = [
|
|
95
|
+
{
|
|
96
|
+
symbol: "usd"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
symbol: "eur"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
symbol: "btc"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
symbol: "eth"
|
|
106
|
+
}
|
|
66
107
|
];
|
|
67
|
-
var defaultCurrencies = [{ symbol: "usd" }, { symbol: "eur" }, { symbol: "btc" }, { symbol: "eth" }];
|
|
68
108
|
|
|
69
109
|
// src/lib/pricesFromCoingecko.ts
|
|
70
110
|
var import_axios = require("@xylabs/axios");
|
|
71
|
-
var pricesFromCoingecko = async (coins, currencies) => {
|
|
111
|
+
var pricesFromCoingecko = /* @__PURE__ */ __name(async (coins, currencies) => {
|
|
72
112
|
const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coins.map(({ name }) => name).join(",")}&vs_currencies=${currencies.map(({ symbol }) => symbol).join(",")}`;
|
|
73
113
|
const coinGeckoSimplePrices = (await import_axios.axios.get(url)).data;
|
|
74
114
|
const assets = {};
|
|
@@ -76,7 +116,7 @@ var pricesFromCoingecko = async (coins, currencies) => {
|
|
|
76
116
|
assets[coingeckoCoinToAssetMap[key]] = value;
|
|
77
117
|
}
|
|
78
118
|
return assets;
|
|
79
|
-
};
|
|
119
|
+
}, "pricesFromCoingecko");
|
|
80
120
|
|
|
81
121
|
// src/Plugin.ts
|
|
82
122
|
var import_coingecko_crypto_market_payload_plugin2 = require("@xyo-network/coingecko-crypto-market-payload-plugin");
|
|
@@ -92,7 +132,13 @@ var CoingeckoCryptoMarketWitnessConfigSchema = "network.xyo.crypto.market.coinge
|
|
|
92
132
|
|
|
93
133
|
// src/Witness.ts
|
|
94
134
|
var CoingeckoCryptoMarketWitness = class extends import_abstract_witness.AbstractWitness {
|
|
95
|
-
static
|
|
135
|
+
static {
|
|
136
|
+
__name(this, "CoingeckoCryptoMarketWitness");
|
|
137
|
+
}
|
|
138
|
+
static configSchemas = [
|
|
139
|
+
...super.configSchemas,
|
|
140
|
+
CoingeckoCryptoMarketWitnessConfigSchema
|
|
141
|
+
];
|
|
96
142
|
static defaultConfigSchema = CoingeckoCryptoMarketWitnessConfigSchema;
|
|
97
143
|
async observeHandler() {
|
|
98
144
|
const assets = await pricesFromCoingecko(this.config?.coins ?? [], this.config?.currencies ?? []);
|
|
@@ -101,18 +147,22 @@ var CoingeckoCryptoMarketWitness = class extends import_abstract_witness.Abstrac
|
|
|
101
147
|
schema: import_coingecko_crypto_market_payload_plugin.CoingeckoCryptoMarketSchema,
|
|
102
148
|
timestamp: Date.now()
|
|
103
149
|
};
|
|
104
|
-
return [
|
|
150
|
+
return [
|
|
151
|
+
payload
|
|
152
|
+
];
|
|
105
153
|
}
|
|
106
154
|
};
|
|
107
155
|
|
|
108
156
|
// src/Plugin.ts
|
|
109
|
-
var CoingeckoCryptoMarketPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
157
|
+
var CoingeckoCryptoMarketPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
|
|
158
|
+
required: {
|
|
159
|
+
[import_coingecko_crypto_market_payload_plugin2.CoingeckoCryptoMarketSchema]: 1
|
|
160
|
+
},
|
|
161
|
+
schema: import_payload_model.PayloadSetSchema
|
|
162
|
+
}, {
|
|
163
|
+
witness: /* @__PURE__ */ __name(async (params) => {
|
|
164
|
+
const result = await CoingeckoCryptoMarketWitness.create(params);
|
|
165
|
+
return result;
|
|
166
|
+
}, "witness")
|
|
167
|
+
}), "CoingeckoCryptoMarketPlugin");
|
|
118
168
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/lib/coinGeckoCoinToAssetMap.ts","../../src/lib/defaults.ts","../../src/lib/pricesFromCoingecko.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/lib/coinGeckoCoinToAssetMap.ts","../../src/lib/defaults.ts","../../src/lib/pricesFromCoingecko.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './lib/index.ts'\n// eslint-disable-next-line import/no-default-export\nexport { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\n","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","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","import { axios } from '@xylabs/axios'\nimport { AssetSymbol, CryptoAsset, CryptoAssetPrices } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nimport { coingeckoCoinToAssetMap } from './coinGeckoCoinToAssetMap.ts'\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 for (const [key, value] of Object.entries(coinGeckoSimplePrices)) {\n assets[coingeckoCoinToAssetMap[key]] = value\n }\n return assets\n}\n","import { CoingeckoCryptoMarketSchema } from '@xyo-network/coingecko-crypto-market-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CoingeckoCryptoMarketWitness } from './Witness.ts'\n\nexport const CoingeckoCryptoMarketPlugin = () =>\n createPayloadSetWitnessPlugin<CoingeckoCryptoMarketWitness>(\n { required: { [CoingeckoCryptoMarketSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await CoingeckoCryptoMarketWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { CoingeckoCryptoMarketPayload, CoingeckoCryptoMarketSchema } from '@xyo-network/coingecko-crypto-market-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { CoingeckoCryptoMarketWitnessConfig } from './Config.ts'\nimport { pricesFromCoingecko } from './lib/index.ts'\nimport { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts'\n\nexport type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>\n\nexport class CoingeckoCryptoMarketWitness<\n TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams,\n> extends AbstractWitness<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CoingeckoCryptoMarketWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = 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","export type CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\nexport const CoingeckoCryptoMarketWitnessConfigSchema: CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;ACEO,IAAMA,0BAAuD;EAClE,eAAe;EACf,WAAW;EACX,OAAO;EACP,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,UAAU;EACV,YAAY;EACZ,mBAAmB;EACnB,OAAO;EACP,eAAe;AACjB;;;ACdO,IAAMC,eAA8B;EACzC;IAAEC,MAAM;EAAU;EAClB;IAAEA,MAAM;EAAc;EACtB;IAAEA,MAAM;EAAM;EACd;IAAEA,MAAM;EAAU;EAClB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAS;EACjB;IAAEA,MAAM;EAAS;EACjB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAkB;EAC1B;IAAEA,MAAM;EAAM;EACd;IAAEA,MAAM;EAAc;;AAGjB,IAAMC,oBAAmC;EAAC;IAAEC,QAAQ;EAAM;EAAG;IAAEA,QAAQ;EAAM;EAAG;IAAEA,QAAQ;EAAM;EAAG;IAAEA,QAAQ;EAAM;;;;AClB1H,mBAAsB;AAQf,IAAMC,sBAAsB,8BAAOC,OAAsBC,eAAAA;AAC9D,QAAMC,MAAM,qDAAqDF,MAAMG,IAAI,CAAC,EAAEC,KAAI,MAAOA,IAAAA,EAAMC,KAAK,GAAA,CAAA,kBAAsBJ,WACvHE,IAAI,CAAC,EAAEG,OAAM,MAAOA,MAAAA,EACpBD,KAAK,GAAA,CAAA;AACR,QAAME,yBAAyB,MAAMC,mBAAMC,IAA2BP,GAAAA,GAAMQ;AAC5E,QAAMC,SAA4B,CAAC;AACnC,aAAW,CAACC,KAAKC,KAAAA,KAAUC,OAAOC,QAAQR,qBAAAA,GAAwB;AAChEI,WAAOK,wBAAwBJ,GAAAA,CAAI,IAAIC;EACzC;AACA,SAAOF;AACT,GAVmC;;;ACRnC,IAAAM,iDAA4C;AAC5C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,oDAA0E;;;ACAnE,IAAMC,2CAAqF;;;ADW3F,IAAMC,+BAAN,cAEGC,wCAAAA;EAdV,OAcUA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAAiD,MAAMC,oBAAoB,KAAKC,QAAQC,SAAS,CAAA,GAAI,KAAKD,QAAQE,cAAc,CAAA,CAAE;AACxI,UAAMC,UAAwC;MAC5CL;MACAM,QAAQC;MACRC,WAAWC,KAAKC,IAAG;IACrB;AAEA,WAAO;MAACL;;EACV;AACF;;;ADtBO,IAAMM,8BAA8B,iCACzCC,wDACE;EAAEC,UAAU;IAAE,CAACC,0EAAAA,GAA8B;EAAE;EAAGC,QAAQC;AAAiB,GAC3E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,6BAA6BC,OAAOH,MAAAA;AACzD,WAAOC;EACT,GAHS;AAIX,CAAA,GARuC;","names":["coingeckoCoinToAssetMap","defaultCoins","name","defaultCurrencies","symbol","pricesFromCoingecko","coins","currencies","url","map","name","join","symbol","coinGeckoSimplePrices","axios","get","data","assets","key","value","Object","entries","coingeckoCoinToAssetMap","import_coingecko_crypto_market_payload_plugin","CoingeckoCryptoMarketWitnessConfigSchema","CoingeckoCryptoMarketWitness","AbstractWitness","configSchemas","CoingeckoCryptoMarketWitnessConfigSchema","defaultConfigSchema","observeHandler","assets","pricesFromCoingecko","config","coins","currencies","payload","schema","CoingeckoCryptoMarketSchema","timestamp","Date","now","CoingeckoCryptoMarketPlugin","createPayloadSetWitnessPlugin","required","CoingeckoCryptoMarketSchema","schema","PayloadSetSchema","witness","params","result","CoingeckoCryptoMarketWitness","create"]}
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './lib/index.
|
|
3
|
-
export { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.
|
|
4
|
-
export * from './Schema.
|
|
5
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './lib/index.ts';
|
|
3
|
+
export { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.ts';
|
|
4
|
+
export * from './Schema.ts';
|
|
5
|
+
export * from './Witness.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './lib/index.
|
|
3
|
-
export { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.
|
|
4
|
-
export * from './Schema.
|
|
5
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './lib/index.ts';
|
|
3
|
+
export { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.ts';
|
|
4
|
+
export * from './Schema.ts';
|
|
5
|
+
export * from './Witness.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './lib/index.
|
|
3
|
-
export { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.
|
|
4
|
-
export * from './Schema.
|
|
5
|
-
export * from './Witness.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './lib/index.ts';
|
|
3
|
+
export { CoingeckoCryptoMarketPlugin, CoingeckoCryptoMarketPlugin as default } from './Plugin.ts';
|
|
4
|
+
export * from './Schema.ts';
|
|
5
|
+
export * from './Witness.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,41 +1,83 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/lib/coinGeckoCoinToAssetMap.ts
|
|
2
5
|
var coingeckoCoinToAssetMap = {
|
|
3
6
|
"binance-usd": "busd",
|
|
4
|
-
bitcoin: "btc",
|
|
5
|
-
bnb: "bnb",
|
|
6
|
-
cardano: "ada",
|
|
7
|
-
dogecoin: "doge",
|
|
8
|
-
ethereum: "eth",
|
|
9
|
-
polkadot: "dot",
|
|
10
|
-
solana: "sol",
|
|
11
|
-
tether: "usdt",
|
|
7
|
+
"bitcoin": "btc",
|
|
8
|
+
"bnb": "bnb",
|
|
9
|
+
"cardano": "ada",
|
|
10
|
+
"dogecoin": "doge",
|
|
11
|
+
"ethereum": "eth",
|
|
12
|
+
"polkadot": "dot",
|
|
13
|
+
"solana": "sol",
|
|
14
|
+
"tether": "usdt",
|
|
12
15
|
"usd-coin": "usdc",
|
|
13
16
|
"wrapped-bitcoin": "wbtc",
|
|
14
|
-
xrp: "xrp",
|
|
17
|
+
"xrp": "xrp",
|
|
15
18
|
"xyo-network": "xyo"
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
// src/lib/defaults.ts
|
|
19
22
|
var defaultCoins = [
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
23
|
+
{
|
|
24
|
+
name: "bitcoin"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "binance-usd"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "bnb"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "cardano"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "dogecoin"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "ethereum"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "polkadot"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "solana"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "tether"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "usd-coin"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "wrapped-bitcoin"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "xrp"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "xyo-network"
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
var defaultCurrencies = [
|
|
64
|
+
{
|
|
65
|
+
symbol: "usd"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
symbol: "eur"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
symbol: "btc"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
symbol: "eth"
|
|
75
|
+
}
|
|
33
76
|
];
|
|
34
|
-
var defaultCurrencies = [{ symbol: "usd" }, { symbol: "eur" }, { symbol: "btc" }, { symbol: "eth" }];
|
|
35
77
|
|
|
36
78
|
// src/lib/pricesFromCoingecko.ts
|
|
37
79
|
import { axios } from "@xylabs/axios";
|
|
38
|
-
var pricesFromCoingecko = async (coins, currencies) => {
|
|
80
|
+
var pricesFromCoingecko = /* @__PURE__ */ __name(async (coins, currencies) => {
|
|
39
81
|
const url = `https://api.coingecko.com/api/v3/simple/price?ids=${coins.map(({ name }) => name).join(",")}&vs_currencies=${currencies.map(({ symbol }) => symbol).join(",")}`;
|
|
40
82
|
const coinGeckoSimplePrices = (await axios.get(url)).data;
|
|
41
83
|
const assets = {};
|
|
@@ -43,7 +85,7 @@ var pricesFromCoingecko = async (coins, currencies) => {
|
|
|
43
85
|
assets[coingeckoCoinToAssetMap[key]] = value;
|
|
44
86
|
}
|
|
45
87
|
return assets;
|
|
46
|
-
};
|
|
88
|
+
}, "pricesFromCoingecko");
|
|
47
89
|
|
|
48
90
|
// src/Plugin.ts
|
|
49
91
|
import { CoingeckoCryptoMarketSchema as CoingeckoCryptoMarketSchema2 } from "@xyo-network/coingecko-crypto-market-payload-plugin";
|
|
@@ -59,7 +101,13 @@ var CoingeckoCryptoMarketWitnessConfigSchema = "network.xyo.crypto.market.coinge
|
|
|
59
101
|
|
|
60
102
|
// src/Witness.ts
|
|
61
103
|
var CoingeckoCryptoMarketWitness = class extends AbstractWitness {
|
|
62
|
-
static
|
|
104
|
+
static {
|
|
105
|
+
__name(this, "CoingeckoCryptoMarketWitness");
|
|
106
|
+
}
|
|
107
|
+
static configSchemas = [
|
|
108
|
+
...super.configSchemas,
|
|
109
|
+
CoingeckoCryptoMarketWitnessConfigSchema
|
|
110
|
+
];
|
|
63
111
|
static defaultConfigSchema = CoingeckoCryptoMarketWitnessConfigSchema;
|
|
64
112
|
async observeHandler() {
|
|
65
113
|
const assets = await pricesFromCoingecko(this.config?.coins ?? [], this.config?.currencies ?? []);
|
|
@@ -68,20 +116,24 @@ var CoingeckoCryptoMarketWitness = class extends AbstractWitness {
|
|
|
68
116
|
schema: CoingeckoCryptoMarketSchema,
|
|
69
117
|
timestamp: Date.now()
|
|
70
118
|
};
|
|
71
|
-
return [
|
|
119
|
+
return [
|
|
120
|
+
payload
|
|
121
|
+
];
|
|
72
122
|
}
|
|
73
123
|
};
|
|
74
124
|
|
|
75
125
|
// src/Plugin.ts
|
|
76
|
-
var CoingeckoCryptoMarketPlugin = () => createPayloadSetWitnessPlugin(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
126
|
+
var CoingeckoCryptoMarketPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
|
|
127
|
+
required: {
|
|
128
|
+
[CoingeckoCryptoMarketSchema2]: 1
|
|
129
|
+
},
|
|
130
|
+
schema: PayloadSetSchema
|
|
131
|
+
}, {
|
|
132
|
+
witness: /* @__PURE__ */ __name(async (params) => {
|
|
133
|
+
const result = await CoingeckoCryptoMarketWitness.create(params);
|
|
134
|
+
return result;
|
|
135
|
+
}, "witness")
|
|
136
|
+
}), "CoingeckoCryptoMarketPlugin");
|
|
85
137
|
export {
|
|
86
138
|
CoingeckoCryptoMarketPlugin,
|
|
87
139
|
CoingeckoCryptoMarketWitness,
|
|
@@ -92,4 +144,4 @@ export {
|
|
|
92
144
|
defaultCurrencies,
|
|
93
145
|
pricesFromCoingecko
|
|
94
146
|
};
|
|
95
|
-
//# sourceMappingURL=index.
|
|
147
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/coinGeckoCoinToAssetMap.ts","../../src/lib/defaults.ts","../../src/lib/pricesFromCoingecko.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/Schema.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","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","import { axios } from '@xylabs/axios'\nimport { AssetSymbol, CryptoAsset, CryptoAssetPrices } from '@xyo-network/coingecko-crypto-market-payload-plugin'\n\nimport { coingeckoCoinToAssetMap } from './coinGeckoCoinToAssetMap.ts'\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 for (const [key, value] of Object.entries(coinGeckoSimplePrices)) {\n assets[coingeckoCoinToAssetMap[key]] = value\n }\n return assets\n}\n","import { CoingeckoCryptoMarketSchema } from '@xyo-network/coingecko-crypto-market-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CoingeckoCryptoMarketWitness } from './Witness.ts'\n\nexport const CoingeckoCryptoMarketPlugin = () =>\n createPayloadSetWitnessPlugin<CoingeckoCryptoMarketWitness>(\n { required: { [CoingeckoCryptoMarketSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await CoingeckoCryptoMarketWitness.create(params)\n return result\n },\n },\n )\n","import { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { CoingeckoCryptoMarketPayload, CoingeckoCryptoMarketSchema } from '@xyo-network/coingecko-crypto-market-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { CoingeckoCryptoMarketWitnessConfig } from './Config.ts'\nimport { pricesFromCoingecko } from './lib/index.ts'\nimport { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts'\n\nexport type CoingeckoCryptoMarketWitnessParams = WitnessParams<AnyConfigSchema<CoingeckoCryptoMarketWitnessConfig>>\n\nexport class CoingeckoCryptoMarketWitness<\n TParams extends CoingeckoCryptoMarketWitnessParams = CoingeckoCryptoMarketWitnessParams,\n> extends AbstractWitness<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CoingeckoCryptoMarketWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = 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","export type CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\nexport const CoingeckoCryptoMarketWitnessConfigSchema: CoingeckoCryptoMarketWitnessConfigSchema = 'network.xyo.crypto.market.coingecko.witness.config'\n"],"mappings":";;;;AAEO,IAAMA,0BAAuD;EAClE,eAAe;EACf,WAAW;EACX,OAAO;EACP,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,UAAU;EACV,YAAY;EACZ,mBAAmB;EACnB,OAAO;EACP,eAAe;AACjB;;;ACdO,IAAMC,eAA8B;EACzC;IAAEC,MAAM;EAAU;EAClB;IAAEA,MAAM;EAAc;EACtB;IAAEA,MAAM;EAAM;EACd;IAAEA,MAAM;EAAU;EAClB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAS;EACjB;IAAEA,MAAM;EAAS;EACjB;IAAEA,MAAM;EAAW;EACnB;IAAEA,MAAM;EAAkB;EAC1B;IAAEA,MAAM;EAAM;EACd;IAAEA,MAAM;EAAc;;AAGjB,IAAMC,oBAAmC;EAAC;IAAEC,QAAQ;EAAM;EAAG;IAAEA,QAAQ;EAAM;EAAG;IAAEA,QAAQ;EAAM;EAAG;IAAEA,QAAQ;EAAM;;;;AClB1H,SAASC,aAAa;AAQf,IAAMC,sBAAsB,8BAAOC,OAAsBC,eAAAA;AAC9D,QAAMC,MAAM,qDAAqDF,MAAMG,IAAI,CAAC,EAAEC,KAAI,MAAOA,IAAAA,EAAMC,KAAK,GAAA,CAAA,kBAAsBJ,WACvHE,IAAI,CAAC,EAAEG,OAAM,MAAOA,MAAAA,EACpBD,KAAK,GAAA,CAAA;AACR,QAAME,yBAAyB,MAAMC,MAAMC,IAA2BP,GAAAA,GAAMQ;AAC5E,QAAMC,SAA4B,CAAC;AACnC,aAAW,CAACC,KAAKC,KAAAA,KAAUC,OAAOC,QAAQR,qBAAAA,GAAwB;AAChEI,WAAOK,wBAAwBJ,GAAAA,CAAI,IAAIC;EACzC;AACA,SAAOF;AACT,GAVmC;;;ACRnC,SAASM,+BAAAA,oCAAmC;AAC5C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,uBAAuB;AAChC,SAAuCC,mCAAmC;;;ACAnE,IAAMC,2CAAqF;;;ADW3F,IAAMC,+BAAN,cAEGC,gBAAAA;EAdV,OAcUA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAAiD,MAAMC,oBAAoB,KAAKC,QAAQC,SAAS,CAAA,GAAI,KAAKD,QAAQE,cAAc,CAAA,CAAE;AACxI,UAAMC,UAAwC;MAC5CL;MACAM,QAAQC;MACRC,WAAWC,KAAKC,IAAG;IACrB;AAEA,WAAO;MAACL;;EACV;AACF;;;ADtBO,IAAMM,8BAA8B,6BACzCC,8BACE;EAAEC,UAAU;IAAE,CAACC,4BAAAA,GAA8B;EAAE;EAAGC,QAAQC;AAAiB,GAC3E;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,6BAA6BC,OAAOH,MAAAA;AACzD,WAAOC;EACT,GAHS;AAIX,CAAA,GARuC;","names":["coingeckoCoinToAssetMap","defaultCoins","name","defaultCurrencies","symbol","axios","pricesFromCoingecko","coins","currencies","url","map","name","join","symbol","coinGeckoSimplePrices","axios","get","data","assets","key","value","Object","entries","coingeckoCoinToAssetMap","CoingeckoCryptoMarketSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","AbstractWitness","CoingeckoCryptoMarketSchema","CoingeckoCryptoMarketWitnessConfigSchema","CoingeckoCryptoMarketWitness","AbstractWitness","configSchemas","CoingeckoCryptoMarketWitnessConfigSchema","defaultConfigSchema","observeHandler","assets","pricesFromCoingecko","config","coins","currencies","payload","schema","CoingeckoCryptoMarketSchema","timestamp","Date","now","CoingeckoCryptoMarketPlugin","createPayloadSetWitnessPlugin","required","CoingeckoCryptoMarketSchema","schema","PayloadSetSchema","witness","params","result","CoingeckoCryptoMarketWitness","create"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './coinGeckoCoinToAssetMap.
|
|
2
|
-
export * from './defaults.
|
|
3
|
-
export * from './pricesFromCoingecko.
|
|
1
|
+
export * from './coinGeckoCoinToAssetMap.ts';
|
|
2
|
+
export * from './defaults.ts';
|
|
3
|
+
export * from './pricesFromCoingecko.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './coinGeckoCoinToAssetMap.
|
|
2
|
-
export * from './defaults.
|
|
3
|
-
export * from './pricesFromCoingecko.
|
|
1
|
+
export * from './coinGeckoCoinToAssetMap.ts';
|
|
2
|
+
export * from './defaults.ts';
|
|
3
|
+
export * from './pricesFromCoingecko.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './coinGeckoCoinToAssetMap.
|
|
2
|
-
export * from './defaults.
|
|
3
|
-
export * from './pricesFromCoingecko.
|
|
1
|
+
export * from './coinGeckoCoinToAssetMap.ts';
|
|
2
|
+
export * from './defaults.ts';
|
|
3
|
+
export * from './pricesFromCoingecko.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
2
|
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts';
|
|
4
4
|
export type CoingeckoCryptoMarketWitnessConfig = WitnessConfig<{
|
|
5
5
|
coins?: CryptoAsset[];
|
|
6
6
|
currencies?: CryptoAsset[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
2
|
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts';
|
|
4
4
|
export type CoingeckoCryptoMarketWitnessConfig = WitnessConfig<{
|
|
5
5
|
coins?: CryptoAsset[];
|
|
6
6
|
currencies?: CryptoAsset[];
|
package/dist/neutral/Config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CryptoAsset } from '@xyo-network/coingecko-crypto-market-payload-plugin';
|
|
2
2
|
import { WitnessConfig } from '@xyo-network/witness-model';
|
|
3
|
-
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.
|
|
3
|
+
import { CoingeckoCryptoMarketWitnessConfigSchema } from './Schema.ts';
|
|
4
4
|
export type CoingeckoCryptoMarketWitnessConfig = WitnessConfig<{
|
|
5
5
|
coins?: CryptoAsset[];
|
|
6
6
|
currencies?: CryptoAsset[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CoingeckoCryptoMarketWitness } from './Witness.
|
|
1
|
+
import { CoingeckoCryptoMarketWitness } from './Witness.ts';
|
|
2
2
|
export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CoingeckoCryptoMarketWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -9,7 +9,7 @@ export declare const CoingeckoCryptoMarketPlugin: () => import("@xyo-network/pay
|
|
|
9
9
|
} & {
|
|
10
10
|
coins?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
11
11
|
currencies?: import("@xyo-network/coingecko-crypto-market-payload-plugin").CryptoAsset[];
|
|
12
|
-
schema: import("./Schema.
|
|
12
|
+
schema: import("./Schema.ts").CoingeckoCryptoMarketWitnessConfigSchema;
|
|
13
13
|
}, "schema"> & {
|
|
14
14
|
schema: "network.xyo.crypto.market.coingecko.witness.config";
|
|
15
15
|
}, "schema"> & {
|