@xyo-network/gas-price-plugin 2.82.2 → 2.84.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.
Files changed (107) hide show
  1. package/dist/browser/Diviner.d.cts +1 -2
  2. package/dist/browser/Diviner.d.cts.map +1 -1
  3. package/dist/browser/Diviner.d.mts +1 -2
  4. package/dist/browser/Diviner.d.mts.map +1 -1
  5. package/dist/browser/Diviner.d.ts +1 -2
  6. package/dist/browser/Diviner.d.ts.map +1 -1
  7. package/dist/browser/Plugin.d.cts +396 -6
  8. package/dist/browser/Plugin.d.cts.map +1 -1
  9. package/dist/browser/Plugin.d.mts +396 -6
  10. package/dist/browser/Plugin.d.mts.map +1 -1
  11. package/dist/browser/Plugin.d.ts +396 -6
  12. package/dist/browser/Plugin.d.ts.map +1 -1
  13. package/dist/browser/index.cjs +4 -4
  14. package/dist/browser/index.cjs.map +1 -1
  15. package/dist/browser/index.js +4 -4
  16. package/dist/browser/index.js.map +1 -1
  17. package/dist/browser/lib/divineGas.d.cts +1 -1
  18. package/dist/browser/lib/divineGas.d.cts.map +1 -1
  19. package/dist/browser/lib/divineGas.d.mts +1 -1
  20. package/dist/browser/lib/divineGas.d.mts.map +1 -1
  21. package/dist/browser/lib/divineGas.d.ts +1 -1
  22. package/dist/browser/lib/divineGas.d.ts.map +1 -1
  23. package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.cts +5 -2
  24. package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +1 -1
  25. package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.mts +5 -2
  26. package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +1 -1
  27. package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.ts +5 -2
  28. package/dist/browser/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +1 -1
  29. package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +5 -2
  30. package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +1 -1
  31. package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +5 -2
  32. package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +1 -1
  33. package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +5 -2
  34. package/dist/browser/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +1 -1
  35. package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.cts +5 -2
  36. package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.cts.map +1 -1
  37. package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.mts +5 -2
  38. package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.mts.map +1 -1
  39. package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.ts +5 -2
  40. package/dist/browser/lib/identities/isEthereumGasEthersPayload.d.ts.map +1 -1
  41. package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.cts +5 -2
  42. package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +1 -1
  43. package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.mts +5 -2
  44. package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +1 -1
  45. package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.ts +5 -2
  46. package/dist/browser/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +1 -1
  47. package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.cts +5 -2
  48. package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +1 -1
  49. package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.mts +5 -2
  50. package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +1 -1
  51. package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.ts +5 -2
  52. package/dist/browser/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +1 -1
  53. package/dist/node/Diviner.d.cts +1 -2
  54. package/dist/node/Diviner.d.cts.map +1 -1
  55. package/dist/node/Diviner.d.mts +1 -2
  56. package/dist/node/Diviner.d.mts.map +1 -1
  57. package/dist/node/Diviner.d.ts +1 -2
  58. package/dist/node/Diviner.d.ts.map +1 -1
  59. package/dist/node/Plugin.d.cts +396 -6
  60. package/dist/node/Plugin.d.cts.map +1 -1
  61. package/dist/node/Plugin.d.mts +396 -6
  62. package/dist/node/Plugin.d.mts.map +1 -1
  63. package/dist/node/Plugin.d.ts +396 -6
  64. package/dist/node/Plugin.d.ts.map +1 -1
  65. package/dist/node/index.js +4 -4
  66. package/dist/node/index.js.map +1 -1
  67. package/dist/node/index.mjs +4 -4
  68. package/dist/node/index.mjs.map +1 -1
  69. package/dist/node/lib/divineGas.d.cts +1 -1
  70. package/dist/node/lib/divineGas.d.cts.map +1 -1
  71. package/dist/node/lib/divineGas.d.mts +1 -1
  72. package/dist/node/lib/divineGas.d.mts.map +1 -1
  73. package/dist/node/lib/divineGas.d.ts +1 -1
  74. package/dist/node/lib/divineGas.d.ts.map +1 -1
  75. package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.cts +5 -2
  76. package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.cts.map +1 -1
  77. package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.mts +5 -2
  78. package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.mts.map +1 -1
  79. package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.ts +5 -2
  80. package/dist/node/lib/identities/isEthereumGasBlocknativePayload.d.ts.map +1 -1
  81. package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.cts +5 -2
  82. package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.cts.map +1 -1
  83. package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.mts +5 -2
  84. package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.mts.map +1 -1
  85. package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.ts +5 -2
  86. package/dist/node/lib/identities/isEthereumGasEtherchainV2Payload.d.ts.map +1 -1
  87. package/dist/node/lib/identities/isEthereumGasEthersPayload.d.cts +5 -2
  88. package/dist/node/lib/identities/isEthereumGasEthersPayload.d.cts.map +1 -1
  89. package/dist/node/lib/identities/isEthereumGasEthersPayload.d.mts +5 -2
  90. package/dist/node/lib/identities/isEthereumGasEthersPayload.d.mts.map +1 -1
  91. package/dist/node/lib/identities/isEthereumGasEthersPayload.d.ts +5 -2
  92. package/dist/node/lib/identities/isEthereumGasEthersPayload.d.ts.map +1 -1
  93. package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.cts +5 -2
  94. package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.cts.map +1 -1
  95. package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.mts +5 -2
  96. package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.mts.map +1 -1
  97. package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.ts +5 -2
  98. package/dist/node/lib/identities/isEthereumGasEtherscanPayload.d.ts.map +1 -1
  99. package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.cts +5 -2
  100. package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.cts.map +1 -1
  101. package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.mts +5 -2
  102. package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.mts.map +1 -1
  103. package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.ts +5 -2
  104. package/dist/node/lib/identities/isEthereumGasEthgasstationPayload.d.ts.map +1 -1
  105. package/package.json +20 -20
  106. package/src/Diviner.ts +2 -2
  107. package/src/lib/divineGas.ts +2 -2
@@ -1,7 +1,7 @@
1
1
  import { EthereumGasDiviner } from './Diviner';
2
- export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xyo-network/core").BaseParamsFields & {
2
+ export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetDivinerPlugin<EthereumGasDiviner<import("@xyo-network/object").BaseParamsFields & {
3
3
  account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
4
- config: import("@xyo-network/payload-model").SchemaFields & Omit<{
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;
@@ -17,7 +17,225 @@ export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-pl
17
17
  readonly sign?: boolean | undefined;
18
18
  readonly storeQueries?: boolean | undefined;
19
19
  readonly timestamp?: boolean | undefined;
20
- } & import("@xyo-network/module-model").ArchivingModuleConfig & Omit<import("@xyo-network/payload-model").SchemaFields & Omit<{
20
+ } & import("@xyo-network/module-model").ArchivingModuleConfig & {
21
+ schema: string;
22
+ } & Omit<(import("@xyo-network/payload-model").SchemaFields & object & Omit<{
23
+ accountDerivationPath?: string | undefined;
24
+ readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
25
+ readonly labels?: import("@xyo-network/module-model").Labels | undefined;
26
+ readonly name?: string | undefined;
27
+ readonly paging?: Record<string, {
28
+ size?: number | undefined;
29
+ }> | undefined;
30
+ readonly security?: {
31
+ readonly allowAnonymous?: boolean | undefined;
32
+ readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
33
+ readonly disallowed?: Record<string, string[]> | undefined;
34
+ } | undefined;
35
+ readonly sign?: boolean | undefined;
36
+ readonly storeQueries?: boolean | undefined;
37
+ readonly timestamp?: boolean | undefined;
38
+ } & import("@xyo-network/module-model").ArchivingModuleConfig & {
39
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
40
+ } & Omit<{
41
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
42
+ }, "schema">, "schema"> & {
43
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
62
+ } & Omit<{
63
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
64
+ }, "schema">, "schema"> & {
65
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
84
+ } & Omit<{
85
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
86
+ }, "schema">, "schema"> & {
87
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
106
+ } & Omit<{
107
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
108
+ }, "schema">, "schema"> & {
109
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
148
+ } & Omit<{
149
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
150
+ }, "schema">, "schema"> & {
151
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
170
+ } & Omit<{
171
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
172
+ }, "schema">, "schema"> & {
173
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
192
+ } & Omit<{
193
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
194
+ }, "schema">, "schema"> & {
195
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
214
+ } & Omit<{
215
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
216
+ }, "schema">, "schema"> & {
217
+ schema: "network.xyo.blockchain.ethereum.gas.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<{
21
239
  accountDerivationPath?: string | undefined;
22
240
  readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
23
241
  readonly labels?: import("@xyo-network/module-model").Labels | undefined;
@@ -39,11 +257,183 @@ export declare const EthereumGasPlugin: () => import("@xyo-network/payloadset-pl
39
257
  schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
40
258
  }, "schema">, "schema"> & {
41
259
  schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
42
- }, "schema"> & {
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.blockchain.ethereum.gas.diviner.config";
278
+ } & Omit<{
279
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
280
+ }, "schema">, "schema"> & {
281
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
300
+ } & Omit<{
301
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
302
+ }, "schema">, "schema"> & {
303
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
322
+ } & Omit<{
323
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
324
+ }, "schema">, "schema"> & {
325
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
326
+ }), "schema">, "schema"> & {
43
327
  schema: string;
44
- }, "schema"> & {
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.blockchain.ethereum.gas.diviner.config";
364
+ } & Omit<{
365
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
366
+ }, "schema">, "schema"> & {
367
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
386
+ } & Omit<{
387
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
388
+ }, "schema">, "schema"> & {
389
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
408
+ } & Omit<{
409
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
410
+ }, "schema">, "schema"> & {
411
+ schema: "network.xyo.blockchain.ethereum.gas.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.blockchain.ethereum.gas.diviner.config";
430
+ } & Omit<{
431
+ schema: "network.xyo.blockchain.ethereum.gas.diviner.config";
432
+ }, "schema">, "schema"> & {
433
+ schema: "network.xyo.blockchain.ethereum.gas.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,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ3B,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQ3B,CAAA"}
@@ -240,7 +240,7 @@ var transformGasFromEthgasstation = (payload) => {
240
240
  };
241
241
 
242
242
  // src/lib/divineGas.ts
243
- var divineGas = (payloads) => {
243
+ var divineGas = async (payloads) => {
244
244
  const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative);
245
245
  const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2);
246
246
  const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers);
@@ -249,7 +249,7 @@ var divineGas = (payloads) => {
249
249
  const transactionCosts = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation];
250
250
  const avg = average(transactionCosts);
251
251
  const timestamp = Date.now();
252
- const payload = new import_payload_builder.PayloadBuilder({ schema: import_gas_price_payload_plugin.EthereumGasSchema }).fields({ ...avg, timestamp }).build();
252
+ const payload = await new import_payload_builder.PayloadBuilder({ schema: import_gas_price_payload_plugin.EthereumGasSchema }).fields({ ...avg, timestamp }).build();
253
253
  return payload;
254
254
  };
255
255
 
@@ -261,8 +261,8 @@ var EthereumGasDivinerConfigSchema = "network.xyo.blockchain.ethereum.gas.divine
261
261
  var EthereumGasDiviner = class extends import_abstract_diviner.AbstractDiviner {
262
262
  static configSchemas = [EthereumGasDivinerConfigSchema];
263
263
  static targetSchema = import_gas_price_payload_plugin2.EthereumGasSchema;
264
- divineHandler(payloads) {
265
- const cost = divineGas(payloads ?? []);
264
+ async divineHandler(payloads) {
265
+ const cost = await divineGas(payloads ?? []);
266
266
  return [cost];
267
267
  }
268
268
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Diviner.ts","../../src/lib/divineGas.ts","../../src/lib/average.ts","../../src/lib/identities/isEthereumGasBlocknativePayload.ts","../../src/lib/identities/isEthereumGasEtherchainV2Payload.ts","../../src/lib/identities/isEthereumGasEtherscanPayload.ts","../../src/lib/identities/isEthereumGasEthersPayload.ts","../../src/lib/identities/isEthereumGasEthgasstationPayload.ts","../../src/lib/transforms/transformGasFromBlocknative.ts","../../src/lib/transforms/transformGasFromEtherchainV2.ts","../../src/lib/transforms/transformGasFromEthers.ts","../../src/lib/transforms/transformGasFromEtherscan.ts","../../src/lib/transforms/transformGasFromEthgasstation.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasPlugin } from './Plugin'\n\nexport * from './Diviner'\nexport * from './Schema'\n\nexport { EthereumGasPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasPlugin\n","import { EthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasDiviner } from './Diviner'\n\nexport const EthereumGasPlugin = () =>\n createPayloadSetDivinerPlugin<EthereumGasDiviner>(\n { required: { [EthereumGasSchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await EthereumGasDiviner.create(params)) as EthereumGasDiviner\n },\n },\n )\n","import { Promisable } from '@xylabs/promise'\nimport { AbstractDiviner } from '@xyo-network/abstract-diviner'\nimport { DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner'\nimport { EthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { divineGas } from './lib'\nimport { EthereumGasDivinerConfigSchema } from './Schema'\n\nexport type EthereumGasDivinerConfig = DivinerConfig<{ schema: EthereumGasDivinerConfigSchema }>\nexport type EthereumGasDivinerParams = DivinerParams<AnyConfigSchema<EthereumGasDivinerConfig>>\n\nexport class EthereumGasDiviner<TParams extends EthereumGasDivinerParams = EthereumGasDivinerParams>\n extends AbstractDiviner<TParams>\n implements DivinerModule\n{\n static override readonly configSchemas: string[] = [EthereumGasDivinerConfigSchema]\n static override targetSchema: string = EthereumGasSchema\n\n protected override divineHandler(payloads?: Payload[]): Promisable<Payload[]> {\n const cost = divineGas(payloads ?? [])\n return [cost]\n }\n}\n","import { EthereumGasPayload, EthereumGasSchema, FeeData } from '@xyo-network/gas-price-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { average } from './average'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms'\n\nexport const divineGas = (payloads: Payload[]): EthereumGasPayload => {\n const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative)\n const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2)\n const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers)\n const etherscan = payloads.filter(isEthereumGasEtherscanPayload).map(transformGasFromEtherscan)\n const ethgasstation = payloads.filter(isEthereumGasEthgasstationPayload).map(transformGasFromEthgasstation)\n const transactionCosts: FeeData[] = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation]\n const avg = average(transactionCosts)\n const timestamp = Date.now()\n const payload = new PayloadBuilder<EthereumGasPayload>({ schema: EthereumGasSchema }).fields({ ...avg, timestamp }).build()\n return payload\n}\n","import { exists } from '@xylabs/exists'\nimport { FeeData } from '@xyo-network/gas-price-payload-plugin'\n\n/**\n * Averages an array of numbers\n * @param x Averages an array of numbers\n * @returns The average of the array of numbers or undefined if the\n * array is empty or undefined\n */\nconst listAverage = (x?: number[]) => (x?.length ? x.reduce((a, b) => a + b) / x.length : undefined)\n\n/**\n * Averages the property indicates by the supplied property\n * expression across the array of FeeData\n * @param data The array of data to average\n * @param propertyExpression The expression for the property to\n * average\n * @returns The average of the supplied property across the array\n */\nconst averageProperty = (data: FeeData[], propertyExpression: (x: FeeData) => number | undefined) => {\n return listAverage(data.map(propertyExpression).filter(exists))\n}\n\n/**\n * Averages the supplied FeeData\n * @param input An array of FeeData or undefined\n * @returns The average of the supplied FeeData\n */\nexport const average = (input?: (FeeData | undefined)[]): FeeData => {\n const data = input?.filter(exists) || []\n const averaged: FeeData = {\n baseFee: averageProperty(data, (x) => x.baseFee),\n feePerGas: {\n high: averageProperty(data, (x) => x.feePerGas.high),\n low: averageProperty(data, (x) => x.feePerGas.low),\n medium: averageProperty(data, (x) => x.feePerGas.medium),\n veryHigh: averageProperty(data, (x) => x.feePerGas.veryHigh),\n },\n priorityFeePerGas: {\n high: averageProperty(data, (x) => x.priorityFeePerGas.high),\n low: averageProperty(data, (x) => x.priorityFeePerGas.low),\n medium: averageProperty(data, (x) => x.priorityFeePerGas.medium),\n veryHigh: averageProperty(data, (x) => x.priorityFeePerGas.veryHigh),\n },\n }\n return averaged\n}\n","import { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasBlocknativePayload = (payload?: Payload | null): payload is EthereumGasBlocknativePayload => {\n return payload?.schema === EthereumGasBlocknativeSchema\n}\n","import { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEtherchainV2Payload = (payload?: Payload | null): payload is EthereumGasEtherchainV2Payload => {\n return payload?.schema === EthereumGasEtherchainV2Schema\n}\n","import { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEtherscanPayload = (payload?: Payload | null): payload is EthereumGasEtherscanPayload => {\n return payload?.schema === EthereumGasEtherscanSchema\n}\n","import { EthereumGasEthersPayload, EthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEthersPayload = (payload?: Payload | null): payload is EthereumGasEthersPayload => {\n return payload?.schema === EthereumGasEthersSchema\n}\n","import { EthereumGasEthgasstationPayload, EthereumGasEthgasstationSchema } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEthgasstationPayload = (payload?: Payload | null): payload is EthereumGasEthgasstationPayload => {\n return payload?.schema === EthereumGasEthgasstationSchema\n}\n","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasBlocknativePayload): number | undefined => {\n return payload?.blockPrices?.[0]?.baseFeePerGas\n}\n\nconst getFeePerGas = (payload: EthereumGasBlocknativePayload): Partial<FeePerGas> => {\n const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence)\n const trend = linear([\n [0, sorted?.[0].price],\n [1, sorted?.[1].price],\n [2, sorted?.[2].price],\n [3, sorted?.[3].price],\n [4, sorted?.[4].price],\n ])\n const feePerGas: FeePerGas = {\n low: trend.predict(0.5)[1],\n medium: trend.predict(1.5)[1],\n high: trend.predict(2.5)[1],\n veryHigh: trend.predict(3.5)[1],\n }\n return feePerGas\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasBlocknativePayload): Partial<PriorityFeePerGas> => {\n const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence)\n const trend = linear([\n [0, sorted?.[0].maxPriorityFeePerGas],\n [1, sorted?.[1].maxPriorityFeePerGas],\n [2, sorted?.[2].maxPriorityFeePerGas],\n [3, sorted?.[3].maxPriorityFeePerGas],\n [4, sorted?.[4].maxPriorityFeePerGas],\n ])\n const priorityFeePerGas: PriorityFeePerGas = {\n low: trend.predict(0.5)[1],\n medium: trend.predict(1.5)[1],\n high: trend.predict(2.5)[1],\n veryHigh: trend.predict(3.5)[1],\n }\n return priorityFeePerGas\n}\n\nexport const transformGasFromBlocknative = (payload: EthereumGasBlocknativePayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'\nimport { FeeData, FeePerGas } from '@xyo-network/gas-price-payload-plugin'\n\nconst getFeePerGas = (payload: EthereumGasEtherchainV2Payload): Partial<FeePerGas> => {\n const { slow, standard, fast, rapid } = payload.data\n const low = slow / 1_000_000_000\n const medium = standard / 1_000_000_000\n const high = fast / 1_000_000_000\n const veryHigh = rapid / 1_000_000_000\n return { high, low, medium, veryHigh }\n}\n\nexport const transformGasFromEtherchainV2 = (payload: EthereumGasEtherchainV2Payload): FeeData => {\n const baseFee = undefined\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = {}\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEthersPayload } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\n\nconst getBaseFee = (payload: EthereumGasEthersPayload): number | undefined => {\n const { gasPrice } = payload\n return gasPrice ? gasPrice / 1_000_000_000 : undefined\n}\n\nconst getFeePerGas = (payload: EthereumGasEthersPayload): Partial<FeePerGas> => {\n const { maxFeePerGas } = payload\n const high = maxFeePerGas ? maxFeePerGas / 1_000_000_000 : undefined\n return { high }\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasEthersPayload): Partial<PriorityFeePerGas> => {\n const { maxPriorityFeePerGas } = payload\n const high = maxPriorityFeePerGas ? maxPriorityFeePerGas / 1_000_000_000 : undefined\n return { high }\n}\n\nexport const transformGasFromEthers = (payload: EthereumGasEthersPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasEtherscanPayload): number | undefined => {\n const { suggestBaseFee } = payload.result\n return parseFloat(suggestBaseFee)\n}\n\nconst getFeePerGas = (payload: EthereumGasEtherscanPayload): Partial<FeePerGas> => {\n const { FastGasPrice, ProposeGasPrice, SafeGasPrice } = payload.result\n const low = parseFloat(SafeGasPrice)\n const medium = parseFloat(ProposeGasPrice)\n const high = parseFloat(FastGasPrice)\n const veryHigh = linear([\n [0, low],\n [1, medium],\n [2, high],\n ]).predict(3)[1]\n return { high, low, medium, veryHigh }\n}\n\nexport const transformGasFromEtherscan = (payload: EthereumGasEtherscanPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = {}\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { EthereumGasEthgasstationPayload } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasEthgasstationPayload): number | undefined => {\n const { baseFee } = payload\n return baseFee\n}\n\nconst getFeePerGas = (payload: EthereumGasEthgasstationPayload): Partial<FeePerGas> => {\n const { standard: medium, fast: high, instant: veryHigh } = payload.gasPrice\n const trend = linear([\n [1, medium],\n [2, high],\n [3, veryHigh],\n ])\n const low = trend.predict(0)[1]\n return { low, medium, high, veryHigh }\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasEthgasstationPayload): Partial<PriorityFeePerGas> => {\n const { standard: medium, fast: high, instant: veryHigh } = payload.priorityFee\n const trend = linear([\n [1, medium],\n [2, high],\n [3, veryHigh],\n ])\n const low = trend.predict(0)[1]\n return { low, medium, high, veryHigh }\n}\n\nexport const transformGasFromEthgasstation = (payload: EthereumGasEthgasstationPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","export type EthereumGasDivinerQuerySchema = 'network.xyo.blockchain.ethereum.gas.diviner.query'\nexport const EthereumGasDivinerQuerySchema: EthereumGasDivinerQuerySchema = 'network.xyo.blockchain.ethereum.gas.diviner.query'\n\nexport type EthereumGasDivinerConfigSchema = 'network.xyo.blockchain.ethereum.gas.diviner.config'\nexport const EthereumGasDivinerConfigSchema: EthereumGasDivinerConfigSchema = 'network.xyo.blockchain.ethere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IAAI,6BAA6B;AAC1G,QAAM,mBAA8B,CAAC,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa;AAC/G,QAAM,MAAM,QAAQ,gBAAgB;AACpC,QAAM,YAAY,KAAK,IAAI;AAC3B,QAAM,UAAU,IAAI,sCAAmC,EAAE,QAAQ,kDAAkB,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,UAAU,CAAC,EAAE,MAAM;AAC1H,SAAO;AACT;;;AY9BO,IAAM,gCAA+D;AAGrE,IAAM,iCAAiE;;;AbSvE,IAAM,qBAAN,cACG,wCAEV;AAAA,EACE,OAAyB,gBAA0B,CAAC,8BAA8B;AAAA,EAClF,OAAgB,eAAuB;AAAA,EAEpB,cAAc,UAA6C;AAC5E,UAAM,OAAO,UAAU,YAAY,CAAC,CAAC;AACrC,WAAO,CAAC,IAAI;AAAA,EACd;AACF;;;ADlBO,IAAM,oBAAoB,UAC/B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,kDAAiB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACjE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,mBAAmB,OAAO,MAAM;AAAA,IAChD;AAAA,EACF;AACF;;;ADNF,IAAO,cAAQ;","names":["import_gas_price_payload_plugin","import_gas_price_payload_plugin","getFeePerGas","getBaseFee","getFeePerGas","getPriorityFeePerGas","import_regression","getBaseFee","getFeePerGas","import_regression","getBaseFee","getFeePerGas","getPriorityFeePerGas"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Diviner.ts","../../src/lib/divineGas.ts","../../src/lib/average.ts","../../src/lib/identities/isEthereumGasBlocknativePayload.ts","../../src/lib/identities/isEthereumGasEtherchainV2Payload.ts","../../src/lib/identities/isEthereumGasEtherscanPayload.ts","../../src/lib/identities/isEthereumGasEthersPayload.ts","../../src/lib/identities/isEthereumGasEthgasstationPayload.ts","../../src/lib/transforms/transformGasFromBlocknative.ts","../../src/lib/transforms/transformGasFromEtherchainV2.ts","../../src/lib/transforms/transformGasFromEthers.ts","../../src/lib/transforms/transformGasFromEtherscan.ts","../../src/lib/transforms/transformGasFromEthgasstation.ts","../../src/Schema.ts"],"sourcesContent":["import { EthereumGasPlugin } from './Plugin'\n\nexport * from './Diviner'\nexport * from './Schema'\n\nexport { EthereumGasPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasPlugin\n","import { EthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetDivinerPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasDiviner } from './Diviner'\n\nexport const EthereumGasPlugin = () =>\n createPayloadSetDivinerPlugin<EthereumGasDiviner>(\n { required: { [EthereumGasSchema]: 1 }, schema: PayloadSetSchema },\n {\n diviner: async (params) => {\n return (await EthereumGasDiviner.create(params)) as EthereumGasDiviner\n },\n },\n )\n","import { Promisable } from '@xylabs/promise'\nimport { AbstractDiviner } from '@xyo-network/abstract-diviner'\nimport { DivinerConfig, DivinerModule, DivinerParams } from '@xyo-network/diviner'\nimport { EthereumGasSchema } from '@xyo-network/gas-price-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { divineGas } from './lib'\nimport { EthereumGasDivinerConfigSchema } from './Schema'\n\nexport type EthereumGasDivinerConfig = DivinerConfig<{ schema: EthereumGasDivinerConfigSchema }>\nexport type EthereumGasDivinerParams = DivinerParams<AnyConfigSchema<EthereumGasDivinerConfig>>\n\nexport class EthereumGasDiviner<TParams extends EthereumGasDivinerParams = EthereumGasDivinerParams>\n extends AbstractDiviner<TParams>\n implements DivinerModule\n{\n static override readonly configSchemas: string[] = [EthereumGasDivinerConfigSchema]\n static override targetSchema: string = EthereumGasSchema\n\n protected override async divineHandler(payloads?: Payload[]): Promise<Payload[]> {\n const cost = await divineGas(payloads ?? [])\n return [cost]\n }\n}\n","import { EthereumGasPayload, EthereumGasSchema, FeeData } from '@xyo-network/gas-price-payload-plugin'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { average } from './average'\nimport {\n isEthereumGasBlocknativePayload,\n isEthereumGasEtherchainV2Payload,\n isEthereumGasEtherscanPayload,\n isEthereumGasEthersPayload,\n isEthereumGasEthgasstationPayload,\n} from './identities'\nimport {\n transformGasFromBlocknative,\n transformGasFromEtherchainV2,\n transformGasFromEthers,\n transformGasFromEtherscan,\n transformGasFromEthgasstation,\n} from './transforms'\n\nexport const divineGas = async (payloads: Payload[]): Promise<EthereumGasPayload> => {\n const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative)\n const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2)\n const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers)\n const etherscan = payloads.filter(isEthereumGasEtherscanPayload).map(transformGasFromEtherscan)\n const ethgasstation = payloads.filter(isEthereumGasEthgasstationPayload).map(transformGasFromEthgasstation)\n const transactionCosts: FeeData[] = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation]\n const avg = average(transactionCosts)\n const timestamp = Date.now()\n const payload = await new PayloadBuilder<EthereumGasPayload>({ schema: EthereumGasSchema }).fields({ ...avg, timestamp }).build()\n return payload\n}\n","import { exists } from '@xylabs/exists'\nimport { FeeData } from '@xyo-network/gas-price-payload-plugin'\n\n/**\n * Averages an array of numbers\n * @param x Averages an array of numbers\n * @returns The average of the array of numbers or undefined if the\n * array is empty or undefined\n */\nconst listAverage = (x?: number[]) => (x?.length ? x.reduce((a, b) => a + b) / x.length : undefined)\n\n/**\n * Averages the property indicates by the supplied property\n * expression across the array of FeeData\n * @param data The array of data to average\n * @param propertyExpression The expression for the property to\n * average\n * @returns The average of the supplied property across the array\n */\nconst averageProperty = (data: FeeData[], propertyExpression: (x: FeeData) => number | undefined) => {\n return listAverage(data.map(propertyExpression).filter(exists))\n}\n\n/**\n * Averages the supplied FeeData\n * @param input An array of FeeData or undefined\n * @returns The average of the supplied FeeData\n */\nexport const average = (input?: (FeeData | undefined)[]): FeeData => {\n const data = input?.filter(exists) || []\n const averaged: FeeData = {\n baseFee: averageProperty(data, (x) => x.baseFee),\n feePerGas: {\n high: averageProperty(data, (x) => x.feePerGas.high),\n low: averageProperty(data, (x) => x.feePerGas.low),\n medium: averageProperty(data, (x) => x.feePerGas.medium),\n veryHigh: averageProperty(data, (x) => x.feePerGas.veryHigh),\n },\n priorityFeePerGas: {\n high: averageProperty(data, (x) => x.priorityFeePerGas.high),\n low: averageProperty(data, (x) => x.priorityFeePerGas.low),\n medium: averageProperty(data, (x) => x.priorityFeePerGas.medium),\n veryHigh: averageProperty(data, (x) => x.priorityFeePerGas.veryHigh),\n },\n }\n return averaged\n}\n","import { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasBlocknativePayload = (payload?: Payload | null): payload is EthereumGasBlocknativePayload => {\n return payload?.schema === EthereumGasBlocknativeSchema\n}\n","import { EthereumGasEtherchainV2Payload, EthereumGasEtherchainV2Schema } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEtherchainV2Payload = (payload?: Payload | null): payload is EthereumGasEtherchainV2Payload => {\n return payload?.schema === EthereumGasEtherchainV2Schema\n}\n","import { EthereumGasEtherscanPayload, EthereumGasEtherscanSchema } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEtherscanPayload = (payload?: Payload | null): payload is EthereumGasEtherscanPayload => {\n return payload?.schema === EthereumGasEtherscanSchema\n}\n","import { EthereumGasEthersPayload, EthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEthersPayload = (payload?: Payload | null): payload is EthereumGasEthersPayload => {\n return payload?.schema === EthereumGasEthersSchema\n}\n","import { EthereumGasEthgasstationPayload, EthereumGasEthgasstationSchema } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport const isEthereumGasEthgasstationPayload = (payload?: Payload | null): payload is EthereumGasEthgasstationPayload => {\n return payload?.schema === EthereumGasEthgasstationSchema\n}\n","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { EthereumGasBlocknativePayload } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasBlocknativePayload): number | undefined => {\n return payload?.blockPrices?.[0]?.baseFeePerGas\n}\n\nconst getFeePerGas = (payload: EthereumGasBlocknativePayload): Partial<FeePerGas> => {\n const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence)\n const trend = linear([\n [0, sorted?.[0].price],\n [1, sorted?.[1].price],\n [2, sorted?.[2].price],\n [3, sorted?.[3].price],\n [4, sorted?.[4].price],\n ])\n const feePerGas: FeePerGas = {\n low: trend.predict(0.5)[1],\n medium: trend.predict(1.5)[1],\n high: trend.predict(2.5)[1],\n veryHigh: trend.predict(3.5)[1],\n }\n return feePerGas\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasBlocknativePayload): Partial<PriorityFeePerGas> => {\n const sorted = payload.blockPrices?.[0].estimatedPrices?.sort((a, b) => a.confidence - b.confidence)\n const trend = linear([\n [0, sorted?.[0].maxPriorityFeePerGas],\n [1, sorted?.[1].maxPriorityFeePerGas],\n [2, sorted?.[2].maxPriorityFeePerGas],\n [3, sorted?.[3].maxPriorityFeePerGas],\n [4, sorted?.[4].maxPriorityFeePerGas],\n ])\n const priorityFeePerGas: PriorityFeePerGas = {\n low: trend.predict(0.5)[1],\n medium: trend.predict(1.5)[1],\n high: trend.predict(2.5)[1],\n veryHigh: trend.predict(3.5)[1],\n }\n return priorityFeePerGas\n}\n\nexport const transformGasFromBlocknative = (payload: EthereumGasBlocknativePayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEtherchainV2Payload } from '@xyo-network/etherchain-gas-ethereum-blockchain-payload-plugins'\nimport { FeeData, FeePerGas } from '@xyo-network/gas-price-payload-plugin'\n\nconst getFeePerGas = (payload: EthereumGasEtherchainV2Payload): Partial<FeePerGas> => {\n const { slow, standard, fast, rapid } = payload.data\n const low = slow / 1_000_000_000\n const medium = standard / 1_000_000_000\n const high = fast / 1_000_000_000\n const veryHigh = rapid / 1_000_000_000\n return { high, low, medium, veryHigh }\n}\n\nexport const transformGasFromEtherchainV2 = (payload: EthereumGasEtherchainV2Payload): FeeData => {\n const baseFee = undefined\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = {}\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEthersPayload } from '@xyo-network/ethers-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\n\nconst getBaseFee = (payload: EthereumGasEthersPayload): number | undefined => {\n const { gasPrice } = payload\n return gasPrice ? gasPrice / 1_000_000_000 : undefined\n}\n\nconst getFeePerGas = (payload: EthereumGasEthersPayload): Partial<FeePerGas> => {\n const { maxFeePerGas } = payload\n const high = maxFeePerGas ? maxFeePerGas / 1_000_000_000 : undefined\n return { high }\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasEthersPayload): Partial<PriorityFeePerGas> => {\n const { maxPriorityFeePerGas } = payload\n const high = maxPriorityFeePerGas ? maxPriorityFeePerGas / 1_000_000_000 : undefined\n return { high }\n}\n\nexport const transformGasFromEthers = (payload: EthereumGasEthersPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","import { EthereumGasEtherscanPayload } from '@xyo-network/etherscan-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasEtherscanPayload): number | undefined => {\n const { suggestBaseFee } = payload.result\n return parseFloat(suggestBaseFee)\n}\n\nconst getFeePerGas = (payload: EthereumGasEtherscanPayload): Partial<FeePerGas> => {\n const { FastGasPrice, ProposeGasPrice, SafeGasPrice } = payload.result\n const low = parseFloat(SafeGasPrice)\n const medium = parseFloat(ProposeGasPrice)\n const high = parseFloat(FastGasPrice)\n const veryHigh = linear([\n [0, low],\n [1, medium],\n [2, high],\n ]).predict(3)[1]\n return { high, low, medium, veryHigh }\n}\n\nexport const transformGasFromEtherscan = (payload: EthereumGasEtherscanPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = {}\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","/* eslint-disable sort-keys-fix/sort-keys-fix */\nimport { EthereumGasEthgasstationPayload } from '@xyo-network/ethgasstation-ethereum-gas-payload-plugin'\nimport { FeeData, FeePerGas, PriorityFeePerGas } from '@xyo-network/gas-price-payload-plugin'\nimport { linear } from 'regression'\n\nconst getBaseFee = (payload: EthereumGasEthgasstationPayload): number | undefined => {\n const { baseFee } = payload\n return baseFee\n}\n\nconst getFeePerGas = (payload: EthereumGasEthgasstationPayload): Partial<FeePerGas> => {\n const { standard: medium, fast: high, instant: veryHigh } = payload.gasPrice\n const trend = linear([\n [1, medium],\n [2, high],\n [3, veryHigh],\n ])\n const low = trend.predict(0)[1]\n return { low, medium, high, veryHigh }\n}\n\nconst getPriorityFeePerGas = (payload: EthereumGasEthgasstationPayload): Partial<PriorityFeePerGas> => {\n const { standard: medium, fast: high, instant: veryHigh } = payload.priorityFee\n const trend = linear([\n [1, medium],\n [2, high],\n [3, veryHigh],\n ])\n const low = trend.predict(0)[1]\n return { low, medium, high, veryHigh }\n}\n\nexport const transformGasFromEthgasstation = (payload: EthereumGasEthgasstationPayload): FeeData => {\n const baseFee = getBaseFee(payload)\n const feePerGas = getFeePerGas(payload)\n const priorityFeePerGas = getPriorityFeePerGas(payload)\n return { baseFee, feePerGas, priorityFeePerGas }\n}\n","export type EthereumGasDivinerQuerySchema = 'network.xyo.blockchain.ethereum.gas.diviner.query'\nexport const EthereumGasDivinerQuerySchema: EthereumGasDivinerQuerySchema = 'network.xyo.blockchain.ethereum.gas.diviner.query'\n\nexport type EthereumGasDivinerConfigSchema = 'network.xyo.blockchain.ethereum.gas.diviner.config'\nexport const EthereumGasDivinerConfigSchema: EthereumGasDivinerConfigSchema = 'network.xyo.blockchain.ethereum.gas.diviner.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,mCAAkC;AAClC,2BAAiC;AACjC,+BAA8C;;;ACD9C,8BAAgC;AAEhC,IAAAC,mCAAkC;;;ACHlC,sCAA+D;AAC/D,6BAA+B;;;ACD/B,oBAAuB;AASvB,IAAM,cAAc,CAAC,MAAkB,GAAG,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,SAAS;AAU1F,IAAM,kBAAkB,CAAC,MAAiB,uBAA2D;AACnG,SAAO,YAAY,KAAK,IAAI,kBAAkB,EAAE,OAAO,oBAAM,CAAC;AAChE;AAOO,IAAM,UAAU,CAAC,UAA6C;AACnE,QAAM,OAAO,OAAO,OAAO,oBAAM,KAAK,CAAC;AACvC,QAAM,WAAoB;AAAA,IACxB,SAAS,gBA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O,IAAM,oBAAoB,UAC/B;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,kDAAiB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACjE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,mBAAmB,OAAO,MAAM;AAAA,IAChD;AAAA,EACF;AACF;;;ADNF,IAAO,cAAQ;","names":["import_gas_price_payload_plugin","import_gas_price_payload_plugin","getFeePerGas","getBaseFee","getFeePerGas","getPriorityFeePerGas","import_regression","getBaseFee","getFeePerGas","import_regression","getBaseFee","getFeePerGas","getPriorityFeePerGas"]}
@@ -210,7 +210,7 @@ var transformGasFromEthgasstation = (payload) => {
210
210
  };
211
211
 
212
212
  // src/lib/divineGas.ts
213
- var divineGas = (payloads) => {
213
+ var divineGas = async (payloads) => {
214
214
  const blocknative = payloads.filter(isEthereumGasBlocknativePayload).map(transformGasFromBlocknative);
215
215
  const etherchainV2 = payloads.filter(isEthereumGasEtherchainV2Payload).map(transformGasFromEtherchainV2);
216
216
  const ethers = payloads.filter(isEthereumGasEthersPayload).map(transformGasFromEthers);
@@ -219,7 +219,7 @@ var divineGas = (payloads) => {
219
219
  const transactionCosts = [...blocknative, ...etherchainV2, ...ethers, ...etherscan, ...ethgasstation];
220
220
  const avg = average(transactionCosts);
221
221
  const timestamp = Date.now();
222
- const payload = new PayloadBuilder({ schema: EthereumGasSchema }).fields({ ...avg, timestamp }).build();
222
+ const payload = await new PayloadBuilder({ schema: EthereumGasSchema }).fields({ ...avg, timestamp }).build();
223
223
  return payload;
224
224
  };
225
225
 
@@ -231,8 +231,8 @@ var EthereumGasDivinerConfigSchema = "network.xyo.blockchain.ethereum.gas.divine
231
231
  var EthereumGasDiviner = class extends AbstractDiviner {
232
232
  static configSchemas = [EthereumGasDivinerConfigSchema];
233
233
  static targetSchema = EthereumGasSchema2;
234
- divineHandler(payloads) {
235
- const cost = divineGas(payloads ?? []);
234
+ async divineHandler(payloads) {
235
+ const cost = await divineGas(payloads ?? []);
236
236
  return [cost];
237
237
  }
238
238
  };