@xyo-network/crypto-asset-plugin 2.83.0 → 2.84.1
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/Diviner.d.cts +1 -2
- package/dist/browser/Diviner.d.cts.map +1 -1
- package/dist/browser/Diviner.d.mts +1 -2
- package/dist/browser/Diviner.d.mts.map +1 -1
- package/dist/browser/Diviner.d.ts +1 -2
- package/dist/browser/Diviner.d.ts.map +1 -1
- package/dist/browser/Plugin.d.cts +393 -3
- package/dist/browser/Plugin.d.cts.map +1 -1
- package/dist/browser/Plugin.d.mts +393 -3
- package/dist/browser/Plugin.d.mts.map +1 -1
- package/dist/browser/Plugin.d.ts +393 -3
- package/dist/browser/Plugin.d.ts.map +1 -1
- package/dist/browser/index.cjs +10 -10
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +10 -10
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/lib/divineCoinGeckoPrices.d.cts +1 -1
- package/dist/browser/lib/divineCoinGeckoPrices.d.cts.map +1 -1
- package/dist/browser/lib/divineCoinGeckoPrices.d.mts +1 -1
- package/dist/browser/lib/divineCoinGeckoPrices.d.mts.map +1 -1
- package/dist/browser/lib/divineCoinGeckoPrices.d.ts +1 -1
- package/dist/browser/lib/divineCoinGeckoPrices.d.ts.map +1 -1
- package/dist/browser/lib/divinePrices.d.cts +1 -1
- package/dist/browser/lib/divinePrices.d.cts.map +1 -1
- package/dist/browser/lib/divinePrices.d.mts +1 -1
- package/dist/browser/lib/divinePrices.d.mts.map +1 -1
- package/dist/browser/lib/divinePrices.d.ts +1 -1
- package/dist/browser/lib/divinePrices.d.ts.map +1 -1
- package/dist/browser/lib/divineUniswapPrices.d.cts +1 -1
- package/dist/browser/lib/divineUniswapPrices.d.cts.map +1 -1
- package/dist/browser/lib/divineUniswapPrices.d.mts +1 -1
- package/dist/browser/lib/divineUniswapPrices.d.mts.map +1 -1
- package/dist/browser/lib/divineUniswapPrices.d.ts +1 -1
- package/dist/browser/lib/divineUniswapPrices.d.ts.map +1 -1
- package/dist/node/Diviner.d.cts +1 -2
- package/dist/node/Diviner.d.cts.map +1 -1
- package/dist/node/Diviner.d.mts +1 -2
- package/dist/node/Diviner.d.mts.map +1 -1
- package/dist/node/Diviner.d.ts +1 -2
- package/dist/node/Diviner.d.ts.map +1 -1
- package/dist/node/Plugin.d.cts +393 -3
- package/dist/node/Plugin.d.cts.map +1 -1
- package/dist/node/Plugin.d.mts +393 -3
- package/dist/node/Plugin.d.mts.map +1 -1
- package/dist/node/Plugin.d.ts +393 -3
- package/dist/node/Plugin.d.ts.map +1 -1
- package/dist/node/{index.mjs → index.cjs} +76 -46
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.js +45 -75
- package/dist/node/index.js.map +1 -1
- package/dist/node/lib/divineCoinGeckoPrices.d.cts +1 -1
- package/dist/node/lib/divineCoinGeckoPrices.d.cts.map +1 -1
- package/dist/node/lib/divineCoinGeckoPrices.d.mts +1 -1
- package/dist/node/lib/divineCoinGeckoPrices.d.mts.map +1 -1
- package/dist/node/lib/divineCoinGeckoPrices.d.ts +1 -1
- package/dist/node/lib/divineCoinGeckoPrices.d.ts.map +1 -1
- package/dist/node/lib/divinePrices.d.cts +1 -1
- package/dist/node/lib/divinePrices.d.cts.map +1 -1
- package/dist/node/lib/divinePrices.d.mts +1 -1
- package/dist/node/lib/divinePrices.d.mts.map +1 -1
- package/dist/node/lib/divinePrices.d.ts +1 -1
- package/dist/node/lib/divinePrices.d.ts.map +1 -1
- package/dist/node/lib/divineUniswapPrices.d.cts +1 -1
- package/dist/node/lib/divineUniswapPrices.d.cts.map +1 -1
- package/dist/node/lib/divineUniswapPrices.d.mts +1 -1
- package/dist/node/lib/divineUniswapPrices.d.mts.map +1 -1
- package/dist/node/lib/divineUniswapPrices.d.ts +1 -1
- package/dist/node/lib/divineUniswapPrices.d.ts.map +1 -1
- package/package.json +19 -20
- package/src/Diviner.ts +2 -3
- package/src/lib/divineCoinGeckoPrices.ts +2 -2
- package/src/lib/divinePrices.ts +5 -5
- package/src/lib/divineUniswapPrices.ts +2 -2
- package/dist/node/index.mjs.map +0 -1
package/dist/node/Plugin.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CryptoMarketAssetDiviner } from './Diviner';
|
|
2
2
|
export declare const CryptoMarketAssetPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<CryptoMarketAssetDiviner<import("@xyo-network/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
|
-
config: import("@xyo-network/payload-model").SchemaFields &
|
|
4
|
+
config: (import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
5
5
|
accountDerivationPath?: string | undefined;
|
|
6
6
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
7
7
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -19,7 +19,7 @@ export declare const CryptoMarketAssetPlugin: () => import("@xyo-network/payload
|
|
|
19
19
|
readonly timestamp?: boolean | undefined;
|
|
20
20
|
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
21
21
|
schema: string;
|
|
22
|
-
} & Omit<import("@xyo-network/payload-model").SchemaFields &
|
|
22
|
+
} & Omit<(import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
23
23
|
accountDerivationPath?: string | undefined;
|
|
24
24
|
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
25
25
|
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
@@ -41,9 +41,399 @@ export declare const CryptoMarketAssetPlugin: () => import("@xyo-network/payload
|
|
|
41
41
|
schema: "network.xyo.crypto.asset.diviner.config";
|
|
42
42
|
}, "schema">, "schema"> & {
|
|
43
43
|
schema: "network.xyo.crypto.asset.diviner.config";
|
|
44
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
45
|
+
accountDerivationPath?: string | undefined;
|
|
46
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
47
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
48
|
+
readonly name?: string | undefined;
|
|
49
|
+
readonly paging?: Record<string, {
|
|
50
|
+
size?: number | undefined;
|
|
51
|
+
}> | undefined;
|
|
52
|
+
readonly security?: {
|
|
53
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
54
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
55
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
56
|
+
} | undefined;
|
|
57
|
+
readonly sign?: boolean | undefined;
|
|
58
|
+
readonly storeQueries?: boolean | undefined;
|
|
59
|
+
readonly timestamp?: boolean | undefined;
|
|
60
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
61
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
62
|
+
} & Omit<{
|
|
63
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
64
|
+
}, "schema">, "schema"> & {
|
|
65
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
66
|
+
} & object) | (import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
67
|
+
accountDerivationPath?: string | undefined;
|
|
68
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
69
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
70
|
+
readonly name?: string | undefined;
|
|
71
|
+
readonly paging?: Record<string, {
|
|
72
|
+
size?: number | undefined;
|
|
73
|
+
}> | undefined;
|
|
74
|
+
readonly security?: {
|
|
75
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
76
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
77
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
78
|
+
} | undefined;
|
|
79
|
+
readonly sign?: boolean | undefined;
|
|
80
|
+
readonly storeQueries?: boolean | undefined;
|
|
81
|
+
readonly timestamp?: boolean | undefined;
|
|
82
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
83
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
84
|
+
} & Omit<{
|
|
85
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
86
|
+
}, "schema">, "schema"> & {
|
|
87
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
88
|
+
} & import("@xyo-network/payload-model").PayloadMetaFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
89
|
+
accountDerivationPath?: string | undefined;
|
|
90
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
91
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
92
|
+
readonly name?: string | undefined;
|
|
93
|
+
readonly paging?: Record<string, {
|
|
94
|
+
size?: number | undefined;
|
|
95
|
+
}> | undefined;
|
|
96
|
+
readonly security?: {
|
|
97
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
98
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
99
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
readonly sign?: boolean | undefined;
|
|
102
|
+
readonly storeQueries?: boolean | undefined;
|
|
103
|
+
readonly timestamp?: boolean | undefined;
|
|
104
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
105
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
106
|
+
} & Omit<{
|
|
107
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
108
|
+
}, "schema">, "schema"> & {
|
|
109
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
110
|
+
}), "schema">, "schema"> & {
|
|
111
|
+
schema: string;
|
|
112
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
113
|
+
accountDerivationPath?: string | undefined;
|
|
114
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
115
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
116
|
+
readonly name?: string | undefined;
|
|
117
|
+
readonly paging?: Record<string, {
|
|
118
|
+
size?: number | undefined;
|
|
119
|
+
}> | undefined;
|
|
120
|
+
readonly security?: {
|
|
121
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
122
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
123
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
124
|
+
} | undefined;
|
|
125
|
+
readonly sign?: boolean | undefined;
|
|
126
|
+
readonly storeQueries?: boolean | undefined;
|
|
127
|
+
readonly timestamp?: boolean | undefined;
|
|
128
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
129
|
+
schema: string;
|
|
130
|
+
} & Omit<(import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
131
|
+
accountDerivationPath?: string | undefined;
|
|
132
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
133
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
134
|
+
readonly name?: string | undefined;
|
|
135
|
+
readonly paging?: Record<string, {
|
|
136
|
+
size?: number | undefined;
|
|
137
|
+
}> | undefined;
|
|
138
|
+
readonly security?: {
|
|
139
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
140
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
141
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
readonly sign?: boolean | undefined;
|
|
144
|
+
readonly storeQueries?: boolean | undefined;
|
|
145
|
+
readonly timestamp?: boolean | undefined;
|
|
146
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
147
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
148
|
+
} & Omit<{
|
|
149
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
150
|
+
}, "schema">, "schema"> & {
|
|
151
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
152
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
153
|
+
accountDerivationPath?: string | undefined;
|
|
154
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
155
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
156
|
+
readonly name?: string | undefined;
|
|
157
|
+
readonly paging?: Record<string, {
|
|
158
|
+
size?: number | undefined;
|
|
159
|
+
}> | undefined;
|
|
160
|
+
readonly security?: {
|
|
161
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
162
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
163
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
164
|
+
} | undefined;
|
|
165
|
+
readonly sign?: boolean | undefined;
|
|
166
|
+
readonly storeQueries?: boolean | undefined;
|
|
167
|
+
readonly timestamp?: boolean | undefined;
|
|
168
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
169
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
170
|
+
} & Omit<{
|
|
171
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
172
|
+
}, "schema">, "schema"> & {
|
|
173
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
174
|
+
} & object) | (import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
175
|
+
accountDerivationPath?: string | undefined;
|
|
176
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
177
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
178
|
+
readonly name?: string | undefined;
|
|
179
|
+
readonly paging?: Record<string, {
|
|
180
|
+
size?: number | undefined;
|
|
181
|
+
}> | undefined;
|
|
182
|
+
readonly security?: {
|
|
183
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
184
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
185
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
186
|
+
} | undefined;
|
|
187
|
+
readonly sign?: boolean | undefined;
|
|
188
|
+
readonly storeQueries?: boolean | undefined;
|
|
189
|
+
readonly timestamp?: boolean | undefined;
|
|
190
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
191
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
192
|
+
} & Omit<{
|
|
193
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
194
|
+
}, "schema">, "schema"> & {
|
|
195
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
196
|
+
} & import("@xyo-network/payload-model").PayloadMetaFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
197
|
+
accountDerivationPath?: string | undefined;
|
|
198
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
199
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
200
|
+
readonly name?: string | undefined;
|
|
201
|
+
readonly paging?: Record<string, {
|
|
202
|
+
size?: number | undefined;
|
|
203
|
+
}> | undefined;
|
|
204
|
+
readonly security?: {
|
|
205
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
206
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
207
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
readonly sign?: boolean | undefined;
|
|
210
|
+
readonly storeQueries?: boolean | undefined;
|
|
211
|
+
readonly timestamp?: boolean | undefined;
|
|
212
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
213
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
214
|
+
} & Omit<{
|
|
215
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
216
|
+
}, "schema">, "schema"> & {
|
|
217
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
218
|
+
}), "schema">, "schema"> & {
|
|
219
|
+
schema: string;
|
|
220
|
+
} & object) | (import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
221
|
+
accountDerivationPath?: string | undefined;
|
|
222
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
223
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
224
|
+
readonly name?: string | undefined;
|
|
225
|
+
readonly paging?: Record<string, {
|
|
226
|
+
size?: number | undefined;
|
|
227
|
+
}> | undefined;
|
|
228
|
+
readonly security?: {
|
|
229
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
230
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
231
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
readonly sign?: boolean | undefined;
|
|
234
|
+
readonly storeQueries?: boolean | undefined;
|
|
235
|
+
readonly timestamp?: boolean | undefined;
|
|
236
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
237
|
+
schema: string;
|
|
238
|
+
} & Omit<(import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
239
|
+
accountDerivationPath?: string | undefined;
|
|
240
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
241
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
242
|
+
readonly name?: string | undefined;
|
|
243
|
+
readonly paging?: Record<string, {
|
|
244
|
+
size?: number | undefined;
|
|
245
|
+
}> | undefined;
|
|
246
|
+
readonly security?: {
|
|
247
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
248
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
249
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
250
|
+
} | undefined;
|
|
251
|
+
readonly sign?: boolean | undefined;
|
|
252
|
+
readonly storeQueries?: boolean | undefined;
|
|
253
|
+
readonly timestamp?: boolean | undefined;
|
|
254
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
255
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
256
|
+
} & Omit<{
|
|
257
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
258
|
+
}, "schema">, "schema"> & {
|
|
259
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
260
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
261
|
+
accountDerivationPath?: string | undefined;
|
|
262
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
263
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
264
|
+
readonly name?: string | undefined;
|
|
265
|
+
readonly paging?: Record<string, {
|
|
266
|
+
size?: number | undefined;
|
|
267
|
+
}> | undefined;
|
|
268
|
+
readonly security?: {
|
|
269
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
270
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
271
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
272
|
+
} | undefined;
|
|
273
|
+
readonly sign?: boolean | undefined;
|
|
274
|
+
readonly storeQueries?: boolean | undefined;
|
|
275
|
+
readonly timestamp?: boolean | undefined;
|
|
276
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
277
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
278
|
+
} & Omit<{
|
|
279
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
280
|
+
}, "schema">, "schema"> & {
|
|
281
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
282
|
+
} & object) | (import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
283
|
+
accountDerivationPath?: string | undefined;
|
|
284
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
285
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
286
|
+
readonly name?: string | undefined;
|
|
287
|
+
readonly paging?: Record<string, {
|
|
288
|
+
size?: number | undefined;
|
|
289
|
+
}> | undefined;
|
|
290
|
+
readonly security?: {
|
|
291
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
292
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
293
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
294
|
+
} | undefined;
|
|
295
|
+
readonly sign?: boolean | undefined;
|
|
296
|
+
readonly storeQueries?: boolean | undefined;
|
|
297
|
+
readonly timestamp?: boolean | undefined;
|
|
298
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
299
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
300
|
+
} & Omit<{
|
|
301
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
302
|
+
}, "schema">, "schema"> & {
|
|
303
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
304
|
+
} & import("@xyo-network/payload-model").PayloadMetaFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
305
|
+
accountDerivationPath?: string | undefined;
|
|
306
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
307
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
308
|
+
readonly name?: string | undefined;
|
|
309
|
+
readonly paging?: Record<string, {
|
|
310
|
+
size?: number | undefined;
|
|
311
|
+
}> | undefined;
|
|
312
|
+
readonly security?: {
|
|
313
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
314
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
315
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
316
|
+
} | undefined;
|
|
317
|
+
readonly sign?: boolean | undefined;
|
|
318
|
+
readonly storeQueries?: boolean | undefined;
|
|
319
|
+
readonly timestamp?: boolean | undefined;
|
|
320
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
321
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
322
|
+
} & Omit<{
|
|
323
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
324
|
+
}, "schema">, "schema"> & {
|
|
325
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
326
|
+
}), "schema">, "schema"> & {
|
|
327
|
+
schema: string;
|
|
328
|
+
} & import("@xyo-network/payload-model").PayloadMetaFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
329
|
+
accountDerivationPath?: string | undefined;
|
|
330
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
331
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
332
|
+
readonly name?: string | undefined;
|
|
333
|
+
readonly paging?: Record<string, {
|
|
334
|
+
size?: number | undefined;
|
|
335
|
+
}> | undefined;
|
|
336
|
+
readonly security?: {
|
|
337
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
338
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
339
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
340
|
+
} | undefined;
|
|
341
|
+
readonly sign?: boolean | undefined;
|
|
342
|
+
readonly storeQueries?: boolean | undefined;
|
|
343
|
+
readonly timestamp?: boolean | undefined;
|
|
344
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
345
|
+
schema: string;
|
|
346
|
+
} & Omit<(import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
347
|
+
accountDerivationPath?: string | undefined;
|
|
348
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
349
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
350
|
+
readonly name?: string | undefined;
|
|
351
|
+
readonly paging?: Record<string, {
|
|
352
|
+
size?: number | undefined;
|
|
353
|
+
}> | undefined;
|
|
354
|
+
readonly security?: {
|
|
355
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
356
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
357
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
358
|
+
} | undefined;
|
|
359
|
+
readonly sign?: boolean | undefined;
|
|
360
|
+
readonly storeQueries?: boolean | undefined;
|
|
361
|
+
readonly timestamp?: boolean | undefined;
|
|
362
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
363
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
364
|
+
} & Omit<{
|
|
365
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
366
|
+
}, "schema">, "schema"> & {
|
|
367
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
368
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
369
|
+
accountDerivationPath?: string | undefined;
|
|
370
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
371
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
372
|
+
readonly name?: string | undefined;
|
|
373
|
+
readonly paging?: Record<string, {
|
|
374
|
+
size?: number | undefined;
|
|
375
|
+
}> | undefined;
|
|
376
|
+
readonly security?: {
|
|
377
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
378
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
379
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
380
|
+
} | undefined;
|
|
381
|
+
readonly sign?: boolean | undefined;
|
|
382
|
+
readonly storeQueries?: boolean | undefined;
|
|
383
|
+
readonly timestamp?: boolean | undefined;
|
|
384
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
385
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
386
|
+
} & Omit<{
|
|
387
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
388
|
+
}, "schema">, "schema"> & {
|
|
389
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
390
|
+
} & object) | (import("@xyo-network/payload-model").SchemaFields & object & Omit<{
|
|
391
|
+
accountDerivationPath?: string | undefined;
|
|
392
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
393
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
394
|
+
readonly name?: string | undefined;
|
|
395
|
+
readonly paging?: Record<string, {
|
|
396
|
+
size?: number | undefined;
|
|
397
|
+
}> | undefined;
|
|
398
|
+
readonly security?: {
|
|
399
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
400
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
401
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
402
|
+
} | undefined;
|
|
403
|
+
readonly sign?: boolean | undefined;
|
|
404
|
+
readonly storeQueries?: boolean | undefined;
|
|
405
|
+
readonly timestamp?: boolean | undefined;
|
|
406
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
407
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
408
|
+
} & Omit<{
|
|
409
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
44
410
|
}, "schema">, "schema"> & {
|
|
411
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
412
|
+
} & import("@xyo-network/payload-model").PayloadMetaFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & Omit<{
|
|
413
|
+
accountDerivationPath?: string | undefined;
|
|
414
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
415
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
416
|
+
readonly name?: string | undefined;
|
|
417
|
+
readonly paging?: Record<string, {
|
|
418
|
+
size?: number | undefined;
|
|
419
|
+
}> | undefined;
|
|
420
|
+
readonly security?: {
|
|
421
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
422
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
423
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
424
|
+
} | undefined;
|
|
425
|
+
readonly sign?: boolean | undefined;
|
|
426
|
+
readonly storeQueries?: boolean | undefined;
|
|
427
|
+
readonly timestamp?: boolean | undefined;
|
|
428
|
+
} & import("@xyo-network/module-model").ArchivingModuleConfig & {
|
|
429
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
430
|
+
} & Omit<{
|
|
431
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
432
|
+
}, "schema">, "schema"> & {
|
|
433
|
+
schema: "network.xyo.crypto.asset.diviner.config";
|
|
434
|
+
}), "schema">, "schema"> & {
|
|
45
435
|
schema: string;
|
|
46
|
-
};
|
|
436
|
+
});
|
|
47
437
|
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
48
438
|
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
49
439
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQjC,CAAA"}
|
|
@@ -1,21 +1,51 @@
|
|
|
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
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
CryptoMarketAssetDiviner: () => CryptoMarketAssetDiviner,
|
|
24
|
+
CryptoMarketAssetDivinerConfigSchema: () => CryptoMarketAssetDivinerConfigSchema,
|
|
25
|
+
CryptoMarketAssetDivinerQuerySchema: () => CryptoMarketAssetDivinerQuerySchema,
|
|
26
|
+
CryptoMarketAssetPlugin: () => CryptoMarketAssetPlugin,
|
|
27
|
+
default: () => src_default
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(src_exports);
|
|
30
|
+
|
|
1
31
|
// src/Plugin.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
32
|
+
var import_crypto_asset_payload_plugin5 = require("@xyo-network/crypto-asset-payload-plugin");
|
|
33
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
34
|
+
var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
|
|
5
35
|
|
|
6
36
|
// src/Diviner.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
37
|
+
var import_abstract_diviner = require("@xyo-network/abstract-diviner");
|
|
38
|
+
var import_coingecko_crypto_market_payload_plugin = require("@xyo-network/coingecko-crypto-market-payload-plugin");
|
|
39
|
+
var import_crypto_asset_payload_plugin4 = require("@xyo-network/crypto-asset-payload-plugin");
|
|
40
|
+
var import_uniswap_crypto_market_payload_plugin = require("@xyo-network/uniswap-crypto-market-payload-plugin");
|
|
11
41
|
|
|
12
42
|
// src/lib/divinePrices.ts
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
43
|
+
var import_exists3 = require("@xylabs/exists");
|
|
44
|
+
var import_crypto_asset_payload_plugin3 = require("@xyo-network/crypto-asset-payload-plugin");
|
|
45
|
+
var import_payload_builder3 = require("@xyo-network/payload-builder");
|
|
16
46
|
|
|
17
47
|
// src/lib/average.ts
|
|
18
|
-
|
|
48
|
+
var import_exists = require("@xylabs/exists");
|
|
19
49
|
var isNumber = (val) => {
|
|
20
50
|
return val !== void 0;
|
|
21
51
|
};
|
|
@@ -30,16 +60,16 @@ var averageStringifiedNumbers = (...prices) => {
|
|
|
30
60
|
return numbers.length ? numbers.reduce((sum, n) => sum + n, 0) / numbers.length : void 0;
|
|
31
61
|
};
|
|
32
62
|
var average = (...input) => {
|
|
33
|
-
const payloads = input.filter(exists);
|
|
63
|
+
const payloads = input.filter(import_exists.exists);
|
|
34
64
|
const tokens = new Set(payloads.map((payload) => Object.keys(payload.assets).map((t) => t)).flatMap((t) => t));
|
|
35
65
|
const valuations = new Set(
|
|
36
66
|
[...tokens].map((asset) => {
|
|
37
67
|
const assetInfo = payloads.map((p) => {
|
|
38
68
|
var _a;
|
|
39
69
|
return (_a = p.assets) == null ? void 0 : _a[asset];
|
|
40
|
-
}).filter(exists);
|
|
70
|
+
}).filter(import_exists.exists);
|
|
41
71
|
const valueBasis = new Set(
|
|
42
|
-
assetInfo.map((v) => Object.keys(v.value)).flatMap((v) => v).filter(exists)
|
|
72
|
+
assetInfo.map((v) => Object.keys(v.value)).flatMap((v) => v).filter(import_exists.exists)
|
|
43
73
|
);
|
|
44
74
|
return [...valueBasis];
|
|
45
75
|
}).flatMap((v) => v)
|
|
@@ -49,7 +79,7 @@ var average = (...input) => {
|
|
|
49
79
|
const assetInfo = payloads.map((p) => {
|
|
50
80
|
var _a;
|
|
51
81
|
return (_a = p.assets) == null ? void 0 : _a[token];
|
|
52
|
-
}).filter(exists);
|
|
82
|
+
}).filter(import_exists.exists);
|
|
53
83
|
const value = Object.fromEntries(
|
|
54
84
|
[...valuations].map((valuation) => {
|
|
55
85
|
const assetValuations = assetInfo.map((info) => {
|
|
@@ -67,9 +97,9 @@ var average = (...input) => {
|
|
|
67
97
|
};
|
|
68
98
|
|
|
69
99
|
// src/lib/divineCoinGeckoPrices.ts
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var schema = CryptoMarketAssetSchema;
|
|
100
|
+
var import_crypto_asset_payload_plugin = require("@xyo-network/crypto-asset-payload-plugin");
|
|
101
|
+
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
102
|
+
var schema = import_crypto_asset_payload_plugin.CryptoMarketAssetSchema;
|
|
73
103
|
var valuationExists = (value) => {
|
|
74
104
|
return !!value[1];
|
|
75
105
|
};
|
|
@@ -77,7 +107,7 @@ var otherValueExists = (value) => {
|
|
|
77
107
|
const possiblyNumber = value[1];
|
|
78
108
|
return typeof possiblyNumber === "number" && !isNaN(possiblyNumber);
|
|
79
109
|
};
|
|
80
|
-
var divineCoinGeckoPrices = (payload) => {
|
|
110
|
+
var divineCoinGeckoPrices = async (payload) => {
|
|
81
111
|
const assets = payload && (payload == null ? void 0 : payload.assets) ? Object.fromEntries(
|
|
82
112
|
Object.entries(payload.assets).filter(valuationExists).map(([asset, valuation]) => {
|
|
83
113
|
const value = Object.fromEntries(
|
|
@@ -87,14 +117,14 @@ var divineCoinGeckoPrices = (payload) => {
|
|
|
87
117
|
})
|
|
88
118
|
) : {};
|
|
89
119
|
const timestamp = Date.now();
|
|
90
|
-
return new PayloadBuilder({ schema }).fields({ assets, timestamp }).build();
|
|
120
|
+
return await new import_payload_builder.PayloadBuilder({ schema }).fields({ assets, timestamp }).build();
|
|
91
121
|
};
|
|
92
122
|
|
|
93
123
|
// src/lib/divineUniswapPrices.ts
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var schema2 =
|
|
124
|
+
var import_exists2 = require("@xylabs/exists");
|
|
125
|
+
var import_crypto_asset_payload_plugin2 = require("@xyo-network/crypto-asset-payload-plugin");
|
|
126
|
+
var import_payload_builder2 = require("@xyo-network/payload-builder");
|
|
127
|
+
var schema2 = import_crypto_asset_payload_plugin2.CryptoMarketAssetSchema;
|
|
98
128
|
var mapUniswapToken = (symbol) => {
|
|
99
129
|
if (symbol.toLowerCase() === "wbtc")
|
|
100
130
|
return "btc";
|
|
@@ -105,7 +135,7 @@ var mapUniswapToken = (symbol) => {
|
|
|
105
135
|
return symbol.toLowerCase();
|
|
106
136
|
};
|
|
107
137
|
var pairsContainingToken = (uniswapPayload, token) => {
|
|
108
|
-
return uniswapPayload == null ? void 0 : uniswapPayload.pairs.map((p) => p.tokens).filter((p) => p.some((x) => x.symbol.toLowerCase() === token)).filter(
|
|
138
|
+
return uniswapPayload == null ? void 0 : uniswapPayload.pairs.map((p) => p.tokens).filter((p) => p.some((x) => x.symbol.toLowerCase() === token)).filter(import_exists2.exists);
|
|
109
139
|
};
|
|
110
140
|
var tokensFromPairs = (pairs) => {
|
|
111
141
|
return pairs.map((p) => p.tokens).flat().map((t) => t.symbol.toLowerCase());
|
|
@@ -120,7 +150,7 @@ var valuesFromTokenPairs = (tokensPairs, token) => {
|
|
|
120
150
|
}).map((x) => [mapUniswapToken(x[0]), x[1]])
|
|
121
151
|
);
|
|
122
152
|
};
|
|
123
|
-
var divineUniswapPrices = (uniswapPayload) => {
|
|
153
|
+
var divineUniswapPrices = async (uniswapPayload) => {
|
|
124
154
|
let assets = {};
|
|
125
155
|
if (uniswapPayload) {
|
|
126
156
|
const tokens = new Set(tokensFromPairs(uniswapPayload.pairs));
|
|
@@ -134,18 +164,18 @@ var divineUniswapPrices = (uniswapPayload) => {
|
|
|
134
164
|
);
|
|
135
165
|
}
|
|
136
166
|
const timestamp = Date.now();
|
|
137
|
-
return new
|
|
167
|
+
return await new import_payload_builder2.PayloadBuilder({ schema: schema2 }).fields({ assets, timestamp }).build();
|
|
138
168
|
};
|
|
139
169
|
|
|
140
170
|
// src/lib/divinePrices.ts
|
|
141
|
-
var schema3 =
|
|
142
|
-
var divinePrices = (coinGeckoPayload, uniswapPayload) => {
|
|
143
|
-
const coinGeckoPrices = divineCoinGeckoPrices(coinGeckoPayload);
|
|
144
|
-
const uniswapPrices = divineUniswapPrices(uniswapPayload);
|
|
145
|
-
const prices = [uniswapPayload, coinGeckoPayload].some(
|
|
171
|
+
var schema3 = import_crypto_asset_payload_plugin3.CryptoMarketAssetSchema;
|
|
172
|
+
var divinePrices = async (coinGeckoPayload, uniswapPayload) => {
|
|
173
|
+
const coinGeckoPrices = await divineCoinGeckoPrices(coinGeckoPayload);
|
|
174
|
+
const uniswapPrices = await divineUniswapPrices(uniswapPayload);
|
|
175
|
+
const prices = [uniswapPayload, coinGeckoPayload].some(import_exists3.exists);
|
|
146
176
|
const assets = prices ? average(coinGeckoPrices, uniswapPrices) : {};
|
|
147
177
|
const timestamp = Date.now();
|
|
148
|
-
return new
|
|
178
|
+
return await new import_payload_builder3.PayloadBuilder({ schema: schema3 }).fields({ assets, timestamp }).build();
|
|
149
179
|
};
|
|
150
180
|
|
|
151
181
|
// src/Schema.ts
|
|
@@ -153,20 +183,20 @@ var CryptoMarketAssetDivinerQuerySchema = "network.xyo.crypto.asset.diviner.quer
|
|
|
153
183
|
var CryptoMarketAssetDivinerConfigSchema = "network.xyo.crypto.asset.diviner.config";
|
|
154
184
|
|
|
155
185
|
// src/Diviner.ts
|
|
156
|
-
var CryptoMarketAssetDiviner = class extends AbstractDiviner {
|
|
186
|
+
var CryptoMarketAssetDiviner = class extends import_abstract_diviner.AbstractDiviner {
|
|
157
187
|
static configSchemas = [CryptoMarketAssetDivinerConfigSchema];
|
|
158
|
-
static targetSchema =
|
|
159
|
-
divineHandler(payloads) {
|
|
160
|
-
const coinGeckoPayload = payloads == null ? void 0 : payloads.find((payload) => (payload == null ? void 0 : payload.schema) === CoingeckoCryptoMarketSchema);
|
|
161
|
-
const uniswapPayload = payloads == null ? void 0 : payloads.find((payload) => (payload == null ? void 0 : payload.schema) === UniswapCryptoMarketSchema);
|
|
162
|
-
const result = divinePrices(coinGeckoPayload, uniswapPayload);
|
|
188
|
+
static targetSchema = import_crypto_asset_payload_plugin4.CryptoMarketAssetSchema;
|
|
189
|
+
async divineHandler(payloads) {
|
|
190
|
+
const coinGeckoPayload = payloads == null ? void 0 : payloads.find((payload) => (payload == null ? void 0 : payload.schema) === import_coingecko_crypto_market_payload_plugin.CoingeckoCryptoMarketSchema);
|
|
191
|
+
const uniswapPayload = payloads == null ? void 0 : payloads.find((payload) => (payload == null ? void 0 : payload.schema) === import_uniswap_crypto_market_payload_plugin.UniswapCryptoMarketSchema);
|
|
192
|
+
const result = await divinePrices(coinGeckoPayload, uniswapPayload);
|
|
163
193
|
return [result];
|
|
164
194
|
}
|
|
165
195
|
};
|
|
166
196
|
|
|
167
197
|
// src/Plugin.ts
|
|
168
|
-
var CryptoMarketAssetPlugin = () => createPayloadSetDivinerPlugin(
|
|
169
|
-
{ required: { [
|
|
198
|
+
var CryptoMarketAssetPlugin = () => (0, import_payloadset_plugin.createPayloadSetDivinerPlugin)(
|
|
199
|
+
{ required: { [import_crypto_asset_payload_plugin5.CryptoMarketAssetSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
|
|
170
200
|
{
|
|
171
201
|
diviner: async (params) => {
|
|
172
202
|
return await CryptoMarketAssetDiviner.create(params);
|
|
@@ -176,11 +206,11 @@ var CryptoMarketAssetPlugin = () => createPayloadSetDivinerPlugin(
|
|
|
176
206
|
|
|
177
207
|
// src/index.ts
|
|
178
208
|
var src_default = CryptoMarketAssetPlugin;
|
|
179
|
-
export
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
180
211
|
CryptoMarketAssetDiviner,
|
|
181
212
|
CryptoMarketAssetDivinerConfigSchema,
|
|
182
213
|
CryptoMarketAssetDivinerQuerySchema,
|
|
183
|
-
CryptoMarketAssetPlugin
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
//# sourceMappingURL=index.mjs.map
|
|
214
|
+
CryptoMarketAssetPlugin
|
|
215
|
+
});
|
|
216
|
+
//# sourceMappingURL=index.cjs.map
|