@xyo-network/blocknative-ethereum-gas-plugin 2.73.3 → 2.74.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 (67) hide show
  1. package/dist/Config.d.mts.map +1 -0
  2. package/dist/Config.d.ts +6 -0
  3. package/dist/Config.d.ts.map +1 -0
  4. package/dist/Plugin.d.mts.map +1 -0
  5. package/dist/Plugin.d.ts +3 -0
  6. package/dist/Plugin.d.ts.map +1 -0
  7. package/dist/Schema.d.mts.map +1 -0
  8. package/dist/Schema.d.ts +3 -0
  9. package/dist/Schema.d.ts.map +1 -0
  10. package/dist/Witness.d.mts.map +1 -0
  11. package/dist/Witness.d.ts +10 -0
  12. package/dist/Witness.d.ts.map +1 -0
  13. package/dist/index.d.mts.map +1 -0
  14. package/dist/{esm/index.js → index.d.ts} +1 -2
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +82 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/index.mjs +53 -0
  19. package/dist/index.mjs.map +1 -0
  20. package/dist/lib/getGasFromBlocknative.d.mts.map +1 -0
  21. package/dist/lib/getGasFromBlocknative.d.ts +3 -0
  22. package/dist/lib/getGasFromBlocknative.d.ts.map +1 -0
  23. package/dist/lib/index.d.mts.map +1 -0
  24. package/dist/{esm/lib/index.js → lib/index.d.ts} +1 -1
  25. package/dist/lib/index.d.ts.map +1 -0
  26. package/package.json +29 -22
  27. package/dist/cjs/Config.js +0 -3
  28. package/dist/cjs/Config.js.map +0 -1
  29. package/dist/cjs/Plugin.js +0 -15
  30. package/dist/cjs/Plugin.js.map +0 -1
  31. package/dist/cjs/Schema.js +0 -5
  32. package/dist/cjs/Schema.js.map +0 -1
  33. package/dist/cjs/Witness.js +0 -25
  34. package/dist/cjs/Witness.js.map +0 -1
  35. package/dist/cjs/index.js +0 -12
  36. package/dist/cjs/index.js.map +0 -1
  37. package/dist/cjs/lib/getGasFromBlocknative.js +0 -13
  38. package/dist/cjs/lib/getGasFromBlocknative.js.map +0 -1
  39. package/dist/cjs/lib/index.js +0 -5
  40. package/dist/cjs/lib/index.js.map +0 -1
  41. package/dist/docs.json +0 -16741
  42. package/dist/esm/Config.js +0 -2
  43. package/dist/esm/Config.js.map +0 -1
  44. package/dist/esm/Plugin.js +0 -10
  45. package/dist/esm/Plugin.js.map +0 -1
  46. package/dist/esm/Schema.js +0 -2
  47. package/dist/esm/Schema.js.map +0 -1
  48. package/dist/esm/Witness.js +0 -18
  49. package/dist/esm/Witness.js.map +0 -1
  50. package/dist/esm/index.js.map +0 -1
  51. package/dist/esm/lib/getGasFromBlocknative.js +0 -8
  52. package/dist/esm/lib/getGasFromBlocknative.js.map +0 -1
  53. package/dist/esm/lib/index.js.map +0 -1
  54. package/dist/types/Config.d.ts.map +0 -1
  55. package/dist/types/Plugin.d.ts.map +0 -1
  56. package/dist/types/Schema.d.ts.map +0 -1
  57. package/dist/types/Witness.d.ts.map +0 -1
  58. package/dist/types/index.d.ts.map +0 -1
  59. package/dist/types/lib/getGasFromBlocknative.d.ts.map +0 -1
  60. package/dist/types/lib/index.d.ts.map +0 -1
  61. /package/dist/{types/Config.d.ts → Config.d.mts} +0 -0
  62. /package/dist/{types/Plugin.d.ts → Plugin.d.mts} +0 -0
  63. /package/dist/{types/Schema.d.ts → Schema.d.mts} +0 -0
  64. /package/dist/{types/Witness.d.ts → Witness.d.mts} +0 -0
  65. /package/dist/{types/index.d.ts → index.d.mts} +0 -0
  66. /package/dist/{types/lib/getGasFromBlocknative.d.ts → lib/getGasFromBlocknative.d.mts} +0 -0
  67. /package/dist/{types/lib/index.d.ts → lib/index.d.mts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAA;AAEpE,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,CAAC;IACvE,MAAM,EAAE,yCAAyC,CAAA;CAClD,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { TimestampWitnessConfig } from '@xyo-network/witness';
2
+ import { EthereumGasBlocknativeWitnessConfigSchema } from './Schema';
3
+ export type EthereumGasBlocknativeWitnessConfig = TimestampWitnessConfig<{
4
+ schema: EthereumGasBlocknativeWitnessConfigSchema;
5
+ }>;
6
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,OAAO,EAAE,yCAAyC,EAAE,MAAM,UAAU,CAAA;AAEpE,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,CAAC;IACvE,MAAM,EAAE,yCAAyC,CAAA;CAClD,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AAEzD,eAAO,MAAM,4BAA4B,uGAQtC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { EthereumGasBlocknativeWitness } from './Witness';
2
+ export declare const EthereumGasBlocknativePlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<EthereumGasBlocknativeWitness>;
3
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAA;AAEzD,eAAO,MAAM,4BAA4B,uGAQtC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yCAAyC,GAAG,gEAAgE,CAAA;AACxH,eAAO,MAAM,yCAAyC,EAAE,yCACU,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type EthereumGasBlocknativeWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.blocknative.witness.config';
2
+ export declare const EthereumGasBlocknativeWitnessConfigSchema: EthereumGasBlocknativeWitnessConfigSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../src/Schema.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yCAAyC,GAAG,gEAAgE,CAAA;AACxH,eAAO,MAAM,yCAAyC,EAAE,yCACU,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAA;AAI9D,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,CAAC,eAAe,CAAC,mCAAmC,CAAC,CAAC,CAAA;AAC9H,qBAAa,6BAA8B,SAAQ,eAAe,CAAC,mCAAmC,CAAC;IACrG,OAAgB,aAAa,qEAA8C;cAElD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAS9D"}
@@ -0,0 +1,10 @@
1
+ import { AnyConfigSchema } from '@xyo-network/module';
2
+ import { Payload } from '@xyo-network/payload-model';
3
+ import { AbstractWitness, TimestampWitnessParams } from '@xyo-network/witness';
4
+ import { EthereumGasBlocknativeWitnessConfig } from './Config';
5
+ export type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>;
6
+ export declare class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {
7
+ static configSchemas: "network.xyo.blockchain.ethereum.gas.blocknative.witness.config"[];
8
+ protected observeHandler(): Promise<Payload[]>;
9
+ }
10
+ //# sourceMappingURL=Witness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAA;AAI9D,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,CAAC,eAAe,CAAC,mCAAmC,CAAC,CAAC,CAAA;AAC9H,qBAAa,6BAA8B,SAAQ,eAAe,CAAC,mCAAmC,CAAC;IACrG,OAAgB,aAAa,qEAA8C;cAElD,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAS9D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAEvD,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,4BAA4B,EAAE,CAAA;AAGvC,eAAe,4BAA4B,CAAA"}
@@ -3,6 +3,5 @@ export * from './Config';
3
3
  export * from './Schema';
4
4
  export * from './Witness';
5
5
  export { EthereumGasBlocknativePlugin };
6
- // eslint-disable-next-line import/no-default-export
7
6
  export default EthereumGasBlocknativePlugin;
8
- //# sourceMappingURL=index.js.map
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAEvD,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,4BAA4B,EAAE,CAAA;AAGvC,eAAe,4BAA4B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,82 @@
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
+ EthereumGasBlocknativePlugin: () => EthereumGasBlocknativePlugin,
24
+ EthereumGasBlocknativeWitness: () => EthereumGasBlocknativeWitness,
25
+ EthereumGasBlocknativeWitnessConfigSchema: () => EthereumGasBlocknativeWitnessConfigSchema,
26
+ default: () => src_default
27
+ });
28
+ module.exports = __toCommonJS(src_exports);
29
+
30
+ // src/Plugin.ts
31
+ var import_blocknative_ethereum_gas_payload_plugin2 = require("@xyo-network/blocknative-ethereum-gas-payload-plugin");
32
+ var import_payload_model = require("@xyo-network/payload-model");
33
+ var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
34
+
35
+ // src/Witness.ts
36
+ var import_blocknative_ethereum_gas_payload_plugin = require("@xyo-network/blocknative-ethereum-gas-payload-plugin");
37
+ var import_payload_builder = require("@xyo-network/payload-builder");
38
+ var import_witness = require("@xyo-network/witness");
39
+
40
+ // src/lib/getGasFromBlocknative.ts
41
+ var import_axios = require("@xyo-network/axios");
42
+ var url = "https://api.blocknative.com/gasprices/blockprices";
43
+ var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
44
+ var config = { headers: { Authorization } };
45
+ var getGasFromBlocknative = async () => {
46
+ return (await import_axios.axios.get(url, config)).data;
47
+ };
48
+
49
+ // src/Schema.ts
50
+ var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
51
+
52
+ // src/Witness.ts
53
+ var EthereumGasBlocknativeWitness = class extends import_witness.AbstractWitness {
54
+ static configSchemas = [EthereumGasBlocknativeWitnessConfigSchema];
55
+ async observeHandler() {
56
+ const fields = await getGasFromBlocknative();
57
+ const payload = new import_payload_builder.PayloadBuilder({
58
+ schema: import_blocknative_ethereum_gas_payload_plugin.EthereumGasBlocknativeSchema
59
+ }).fields(fields).build();
60
+ return [payload];
61
+ }
62
+ };
63
+
64
+ // src/Plugin.ts
65
+ var EthereumGasBlocknativePlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
66
+ { required: { [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
67
+ {
68
+ witness: async (params) => {
69
+ return await EthereumGasBlocknativeWitness.create(params);
70
+ }
71
+ }
72
+ );
73
+
74
+ // src/index.ts
75
+ var src_default = EthereumGasBlocknativePlugin;
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ EthereumGasBlocknativePlugin,
79
+ EthereumGasBlocknativeWitness,
80
+ EthereumGasBlocknativeWitnessConfigSchema
81
+ });
82
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/Plugin.ts","../src/Witness.ts","../src/lib/getGasFromBlocknative.ts","../src/Schema.ts"],"sourcesContent":["import { EthereumGasBlocknativePlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { EthereumGasBlocknativePlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasBlocknativePlugin\n","import { EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasBlocknativeWitness } from './Witness'\n\nexport const EthereumGasBlocknativePlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasBlocknativeWitness>(\n { required: { [EthereumGasBlocknativeSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EthereumGasBlocknativeWitness.create(params)) as EthereumGasBlocknativeWitness\n },\n },\n )\n","import { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness, TimestampWitnessParams } from '@xyo-network/witness'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config'\nimport { getGasFromBlocknative } from './lib'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override configSchemas = [EthereumGasBlocknativeWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasBlocknativeResponse } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\n\nconst url = 'https://api.blocknative.com/gasprices/blockprices'\n\nconst Authorization = '9d3e23c3-e31d-4f9c-9d7c-c579cb75d226'\nconst config = { headers: { Authorization } }\n\nexport const getGasFromBlocknative = async (): Promise<EthereumGasBlocknativeResponse> => {\n return (await axios.get<EthereumGasBlocknativeResponse>(url, config)).data\n}\n","export type EthereumGasBlocknativeWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.blocknative.witness.config'\nexport const EthereumGasBlocknativeWitnessConfigSchema: EthereumGasBlocknativeWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.blocknative.witness.config'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,kDAA6C;AAC7C,2BAAiC;AACjC,+BAA8C;;;ACF9C,qDAA4E;AAE5E,6BAA+B;AAE/B,qBAAwD;;;ACJxD,mBAAsB;AAGtB,IAAM,MAAM;AAEZ,IAAM,gBAAgB;AACtB,IAAM,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE;AAErC,IAAM,wBAAwB,YAAqD;AACxF,UAAQ,MAAM,mBAAM,IAAoC,KAAK,MAAM,GAAG;AACxE;;;ACTO,IAAM,4CACX;;;AFSK,IAAM,gCAAN,cAA4C,+BAAqD;AAAA,EACtG,OAAgB,gBAAgB,CAAC,yCAAyC;AAAA,EAE1E,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,IAAI,sCAA8C;AAAA,MAChE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,IAAM,+BAA+B,UAC1C;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,4EAA4B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC5E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,8BAA8B,OAAO,MAAM;AAAA,IAC3D;AAAA,EACF;AACF;;;ADLF,IAAO,cAAQ;","names":["import_blocknative_ethereum_gas_payload_plugin"]}
package/dist/index.mjs ADDED
@@ -0,0 +1,53 @@
1
+ // src/Plugin.ts
2
+ import { EthereumGasBlocknativeSchema as EthereumGasBlocknativeSchema2 } from "@xyo-network/blocknative-ethereum-gas-payload-plugin";
3
+ import { PayloadSetSchema } from "@xyo-network/payload-model";
4
+ import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
+
6
+ // src/Witness.ts
7
+ import { EthereumGasBlocknativeSchema } from "@xyo-network/blocknative-ethereum-gas-payload-plugin";
8
+ import { PayloadBuilder } from "@xyo-network/payload-builder";
9
+ import { AbstractWitness } from "@xyo-network/witness";
10
+
11
+ // src/lib/getGasFromBlocknative.ts
12
+ import { axios } from "@xyo-network/axios";
13
+ var url = "https://api.blocknative.com/gasprices/blockprices";
14
+ var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
15
+ var config = { headers: { Authorization } };
16
+ var getGasFromBlocknative = async () => {
17
+ return (await axios.get(url, config)).data;
18
+ };
19
+
20
+ // src/Schema.ts
21
+ var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
22
+
23
+ // src/Witness.ts
24
+ var EthereumGasBlocknativeWitness = class extends AbstractWitness {
25
+ static configSchemas = [EthereumGasBlocknativeWitnessConfigSchema];
26
+ async observeHandler() {
27
+ const fields = await getGasFromBlocknative();
28
+ const payload = new PayloadBuilder({
29
+ schema: EthereumGasBlocknativeSchema
30
+ }).fields(fields).build();
31
+ return [payload];
32
+ }
33
+ };
34
+
35
+ // src/Plugin.ts
36
+ var EthereumGasBlocknativePlugin = () => createPayloadSetWitnessPlugin(
37
+ { required: { [EthereumGasBlocknativeSchema2]: 1 }, schema: PayloadSetSchema },
38
+ {
39
+ witness: async (params) => {
40
+ return await EthereumGasBlocknativeWitness.create(params);
41
+ }
42
+ }
43
+ );
44
+
45
+ // src/index.ts
46
+ var src_default = EthereumGasBlocknativePlugin;
47
+ export {
48
+ EthereumGasBlocknativePlugin,
49
+ EthereumGasBlocknativeWitness,
50
+ EthereumGasBlocknativeWitnessConfigSchema,
51
+ src_default as default
52
+ };
53
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Plugin.ts","../src/Witness.ts","../src/lib/getGasFromBlocknative.ts","../src/Schema.ts","../src/index.ts"],"sourcesContent":["import { EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { EthereumGasBlocknativeWitness } from './Witness'\n\nexport const EthereumGasBlocknativePlugin = () =>\n createPayloadSetWitnessPlugin<EthereumGasBlocknativeWitness>(\n { required: { [EthereumGasBlocknativeSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n return (await EthereumGasBlocknativeWitness.create(params)) as EthereumGasBlocknativeWitness\n },\n },\n )\n","import { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\nimport { AbstractWitness, TimestampWitnessParams } from '@xyo-network/witness'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config'\nimport { getGasFromBlocknative } from './lib'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override configSchemas = [EthereumGasBlocknativeWitnessConfigSchema]\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xyo-network/axios'\nimport { EthereumGasBlocknativeResponse } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\n\nconst url = 'https://api.blocknative.com/gasprices/blockprices'\n\nconst Authorization = '9d3e23c3-e31d-4f9c-9d7c-c579cb75d226'\nconst config = { headers: { Authorization } }\n\nexport const getGasFromBlocknative = async (): Promise<EthereumGasBlocknativeResponse> => {\n return (await axios.get<EthereumGasBlocknativeResponse>(url, config)).data\n}\n","export type EthereumGasBlocknativeWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.blocknative.witness.config'\nexport const EthereumGasBlocknativeWitnessConfigSchema: EthereumGasBlocknativeWitnessConfigSchema =\n 'network.xyo.blockchain.ethereum.gas.blocknative.witness.config'\n","import { EthereumGasBlocknativePlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './Schema'\nexport * from './Witness'\n\nexport { EthereumGasBlocknativePlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default EthereumGasBlocknativePlugin\n"],"mappings":";AAAA,SAAS,gCAAAA,qCAAoC;AAC7C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAwC,oCAAoC;AAE5E,SAAS,sBAAsB;AAE/B,SAAS,uBAA+C;;;ACJxD,SAAS,aAAa;AAGtB,IAAM,MAAM;AAEZ,IAAM,gBAAgB;AACtB,IAAM,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE;AAErC,IAAM,wBAAwB,YAAqD;AACxF,UAAQ,MAAM,MAAM,IAAoC,KAAK,MAAM,GAAG;AACxE;;;ACTO,IAAM,4CACX;;;AFSK,IAAM,gCAAN,cAA4C,gBAAqD;AAAA,EACtG,OAAgB,gBAAgB,CAAC,yCAAyC;AAAA,EAE1E,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,IAAI,eAA8C;AAAA,MAChE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADjBO,IAAM,+BAA+B,MAC1C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,6BAA4B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC5E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,aAAQ,MAAM,8BAA8B,OAAO,MAAM;AAAA,IAC3D;AAAA,EACF;AACF;;;AILF,IAAO,cAAQ;","names":["EthereumGasBlocknativeSchema","EthereumGasBlocknativeSchema"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGasFromBlocknative.d.ts","sourceRoot":"","sources":["../../src/lib/getGasFromBlocknative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAA;AAOrG,eAAO,MAAM,qBAAqB,QAAa,QAAQ,8BAA8B,CAEpF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { EthereumGasBlocknativeResponse } from '@xyo-network/blocknative-ethereum-gas-payload-plugin';
2
+ export declare const getGasFromBlocknative: () => Promise<EthereumGasBlocknativeResponse>;
3
+ //# sourceMappingURL=getGasFromBlocknative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGasFromBlocknative.d.ts","sourceRoot":"","sources":["../../src/lib/getGasFromBlocknative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAA;AAOrG,eAAO,MAAM,qBAAqB,QAAa,QAAQ,8BAA8B,CAEpF,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
@@ -1,2 +1,2 @@
1
1
  export * from './getGasFromBlocknative';
2
- //# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
package/package.json CHANGED
@@ -10,41 +10,49 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xyo-network/axios": "~2.73.3",
14
- "@xyo-network/blocknative-ethereum-gas-payload-plugin": "~2.73.3",
15
- "@xyo-network/module": "~2.73.3",
16
- "@xyo-network/payload-builder": "~2.73.3",
17
- "@xyo-network/payload-model": "~2.73.3",
18
- "@xyo-network/payloadset-plugin": "~2.73.3",
19
- "@xyo-network/witness": "~2.73.3"
13
+ "@xyo-network/axios": "~2.74.0",
14
+ "@xyo-network/blocknative-ethereum-gas-payload-plugin": "~2.74.0",
15
+ "@xyo-network/module": "~2.74.0",
16
+ "@xyo-network/payload-builder": "~2.74.0",
17
+ "@xyo-network/payload-model": "~2.74.0",
18
+ "@xyo-network/payloadset-plugin": "~2.74.0",
19
+ "@xyo-network/witness": "~2.74.0"
20
20
  },
21
21
  "devDependencies": {
22
- "@xylabs/ts-scripts-yarn3": "^2.19.5",
23
- "@xylabs/tsconfig": "^2.19.5",
22
+ "@xylabs/ts-scripts-yarn3": "^3.0.27",
23
+ "@xylabs/tsconfig": "^3.0.27",
24
24
  "typescript": "^5.2.2"
25
25
  },
26
26
  "description": "Primary SDK for using XYO Protocol 2.0",
27
- "browser": "dist/esm/index.js",
28
27
  "docs": "dist/docs.json",
28
+ "types": "dist/index.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
- "node": {
32
- "import": "./dist/esm/index.js",
33
- "require": "./dist/cjs/index.js"
31
+ "require": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/index.js"
34
34
  },
35
- "browser": {
36
- "import": "./dist/esm/index.js",
37
- "require": "./dist/cjs/index.js"
38
- },
39
- "default": "./dist/esm/index.js"
35
+ "import": {
36
+ "types": "./dist/index.d.mts",
37
+ "default": "./dist/index.mjs"
38
+ }
40
39
  },
41
40
  "./dist/docs.json": {
42
41
  "default": "./dist/docs.json"
43
42
  },
43
+ "./cjs": {
44
+ "default": "./dist/index.js"
45
+ },
46
+ "./docs": {
47
+ "default": "./dist/docs.json"
48
+ },
49
+ "./esm": {
50
+ "default": "./dist/index.mjs"
51
+ },
44
52
  "./package.json": "./package.json"
45
53
  },
46
- "main": "dist/cjs/index.js",
47
- "module": "dist/esm/index.js",
54
+ "main": "dist/index.js",
55
+ "module": "dist/index.mjs",
48
56
  "homepage": "https://xyo.network",
49
57
  "license": "LGPL-3.0",
50
58
  "publishConfig": {
@@ -55,6 +63,5 @@
55
63
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
56
64
  },
57
65
  "sideEffects": false,
58
- "types": "dist/types/index.d.ts",
59
- "version": "2.73.3"
66
+ "version": "2.74.0"
60
67
  }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":""}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EthereumGasBlocknativePlugin = void 0;
4
- const tslib_1 = require("tslib");
5
- const blocknative_ethereum_gas_payload_plugin_1 = require("@xyo-network/blocknative-ethereum-gas-payload-plugin");
6
- const payload_model_1 = require("@xyo-network/payload-model");
7
- const payloadset_plugin_1 = require("@xyo-network/payloadset-plugin");
8
- const Witness_1 = require("./Witness");
9
- const EthereumGasBlocknativePlugin = () => (0, payloadset_plugin_1.createPayloadSetWitnessPlugin)({ required: { [blocknative_ethereum_gas_payload_plugin_1.EthereumGasBlocknativeSchema]: 1 }, schema: payload_model_1.PayloadSetSchema }, {
10
- witness: (params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
11
- return (yield Witness_1.EthereumGasBlocknativeWitness.create(params));
12
- }),
13
- });
14
- exports.EthereumGasBlocknativePlugin = EthereumGasBlocknativePlugin;
15
- //# sourceMappingURL=Plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":";;;;AAAA,kHAAmG;AACnG,8DAA6D;AAC7D,sEAA8E;AAE9E,uCAAyD;AAElD,MAAM,4BAA4B,GAAG,GAAG,EAAE,CAC/C,IAAA,iDAA6B,EAC3B,EAAE,QAAQ,EAAE,EAAE,CAAC,sEAA4B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gCAAgB,EAAE,EAC7E;IACE,OAAO,EAAE,CAAO,MAAM,EAAE,EAAE;QACxB,OAAO,CAAC,MAAM,uCAA6B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAkC,CAAA;IAC9F,CAAC,CAAA;CACF,CACF,CAAA;AARU,QAAA,4BAA4B,gCAQtC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EthereumGasBlocknativeWitnessConfigSchema = void 0;
4
- exports.EthereumGasBlocknativeWitnessConfigSchema = 'network.xyo.blockchain.ethereum.gas.blocknative.witness.config';
5
- //# sourceMappingURL=Schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":";;;AACa,QAAA,yCAAyC,GACpD,gEAAgE,CAAA"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EthereumGasBlocknativeWitness = void 0;
4
- const tslib_1 = require("tslib");
5
- const blocknative_ethereum_gas_payload_plugin_1 = require("@xyo-network/blocknative-ethereum-gas-payload-plugin");
6
- const payload_builder_1 = require("@xyo-network/payload-builder");
7
- const witness_1 = require("@xyo-network/witness");
8
- const lib_1 = require("./lib");
9
- const Schema_1 = require("./Schema");
10
- class EthereumGasBlocknativeWitness extends witness_1.AbstractWitness {
11
- observeHandler() {
12
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- const fields = yield (0, lib_1.getGasFromBlocknative)();
14
- const payload = new payload_builder_1.PayloadBuilder({
15
- schema: blocknative_ethereum_gas_payload_plugin_1.EthereumGasBlocknativeSchema,
16
- })
17
- .fields(fields)
18
- .build();
19
- return [payload];
20
- });
21
- }
22
- }
23
- exports.EthereumGasBlocknativeWitness = EthereumGasBlocknativeWitness;
24
- EthereumGasBlocknativeWitness.configSchemas = [Schema_1.EthereumGasBlocknativeWitnessConfigSchema];
25
- //# sourceMappingURL=Witness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.js","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":";;;;AAAA,kHAAkI;AAElI,kEAA6D;AAE7D,kDAA8E;AAG9E,+BAA6C;AAC7C,qCAAoE;AAGpE,MAAa,6BAA8B,SAAQ,yBAAoD;IAG5E,cAAc;;YACrC,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAqB,GAAE,CAAA;YAC5C,MAAM,OAAO,GAAG,IAAI,gCAAc,CAAgC;gBAChE,MAAM,EAAE,sEAA4B;aACrC,CAAC;iBACC,MAAM,CAAC,MAAM,CAAC;iBACd,KAAK,EAAE,CAAA;YACV,OAAO,CAAC,OAAO,CAAC,CAAA;QAClB,CAAC;KAAA;;AAXH,sEAYC;AAXiB,2CAAa,GAAG,CAAC,kDAAyC,CAAC,CAAA"}
package/dist/cjs/index.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EthereumGasBlocknativePlugin = void 0;
4
- const tslib_1 = require("tslib");
5
- const Plugin_1 = require("./Plugin");
6
- Object.defineProperty(exports, "EthereumGasBlocknativePlugin", { enumerable: true, get: function () { return Plugin_1.EthereumGasBlocknativePlugin; } });
7
- tslib_1.__exportStar(require("./Config"), exports);
8
- tslib_1.__exportStar(require("./Schema"), exports);
9
- tslib_1.__exportStar(require("./Witness"), exports);
10
- // eslint-disable-next-line import/no-default-export
11
- exports.default = Plugin_1.EthereumGasBlocknativePlugin;
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qCAAuD;AAM9C,6GANA,qCAA4B,OAMA;AAJrC,mDAAwB;AACxB,mDAAwB;AACxB,oDAAyB;AAIzB,oDAAoD;AACpD,kBAAe,qCAA4B,CAAA"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGasFromBlocknative = void 0;
4
- const tslib_1 = require("tslib");
5
- const axios_1 = require("@xyo-network/axios");
6
- const url = 'https://api.blocknative.com/gasprices/blockprices';
7
- const Authorization = '9d3e23c3-e31d-4f9c-9d7c-c579cb75d226';
8
- const config = { headers: { Authorization } };
9
- const getGasFromBlocknative = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
10
- return (yield axios_1.axios.get(url, config)).data;
11
- });
12
- exports.getGasFromBlocknative = getGasFromBlocknative;
13
- //# sourceMappingURL=getGasFromBlocknative.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getGasFromBlocknative.js","sourceRoot":"","sources":["../../../src/lib/getGasFromBlocknative.ts"],"names":[],"mappings":";;;;AAAA,8CAA0C;AAG1C,MAAM,GAAG,GAAG,mDAAmD,CAAA;AAE/D,MAAM,aAAa,GAAG,sCAAsC,CAAA;AAC5D,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,EAAE,CAAA;AAEtC,MAAM,qBAAqB,GAAG,GAAkD,EAAE;IACvF,OAAO,CAAC,MAAM,aAAK,CAAC,GAAG,CAAiC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;AAC5E,CAAC,CAAA,CAAA;AAFY,QAAA,qBAAqB,yBAEjC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./getGasFromBlocknative"), exports);
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":";;;AAAA,kEAAuC"}