@xyo-network/blocknative-ethereum-gas-plugin 2.99.5 → 2.99.6

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.
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -42,48 +41,34 @@ var import_payload_builder = require("@xyo-network/payload-builder");
42
41
  var import_axios = require("@xylabs/axios");
43
42
  var url = "https://api.blocknative.com/gasprices/blockprices";
44
43
  var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
45
- var config = {
46
- headers: {
47
- Authorization
48
- }
49
- };
50
- var getGasFromBlocknative = /* @__PURE__ */ __name(async () => {
44
+ var config = { headers: { Authorization } };
45
+ var getGasFromBlocknative = async () => {
51
46
  return (await import_axios.axios.get(url, config)).data;
52
- }, "getGasFromBlocknative");
47
+ };
53
48
 
54
49
  // src/Schema.ts
55
50
  var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
56
51
 
57
52
  // src/Witness.ts
58
53
  var EthereumGasBlocknativeWitness = class extends import_abstract_witness.AbstractWitness {
59
- static {
60
- __name(this, "EthereumGasBlocknativeWitness");
61
- }
62
- static configSchemas = [
63
- ...super.configSchemas,
64
- EthereumGasBlocknativeWitnessConfigSchema
65
- ];
54
+ static configSchemas = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema];
66
55
  static defaultConfigSchema = EthereumGasBlocknativeWitnessConfigSchema;
67
56
  async observeHandler() {
68
57
  const fields = await getGasFromBlocknative();
69
58
  const payload = await new import_payload_builder.PayloadBuilder({
70
59
  schema: import_blocknative_ethereum_gas_payload_plugin.EthereumGasBlocknativeSchema
71
60
  }).fields(fields).build();
72
- return [
73
- payload
74
- ];
61
+ return [payload];
75
62
  }
76
63
  };
77
64
 
78
65
  // src/Plugin.ts
79
- var EthereumGasBlocknativePlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
80
- required: {
81
- [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1
82
- },
83
- schema: import_payload_model.PayloadSetSchema
84
- }, {
85
- witness: /* @__PURE__ */ __name(async (params) => {
86
- return await EthereumGasBlocknativeWitness.create(params);
87
- }, "witness")
88
- }), "EthereumGasBlocknativePlugin");
66
+ var EthereumGasBlocknativePlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
67
+ { required: { [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
68
+ {
69
+ witness: async (params) => {
70
+ return await EthereumGasBlocknativeWitness.create(params);
71
+ }
72
+ }
73
+ );
89
74
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasBlocknativePlugin as default, EthereumGasBlocknativePlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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;;;;;;;;;;ACAA,IAAAA,kDAA6C;AAC7C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,qDAA4E;AAE5E,6BAA+B;;;ACH/B,mBAAsB;AAGtB,IAAMC,MAAM;AAEZ,IAAMC,gBAAgB;AACtB,IAAMC,SAAS;EAAEC,SAAS;IAAEF;EAAc;AAAE;AAErC,IAAMG,wBAAwB,mCAAA;AACnC,UAAQ,MAAMC,mBAAMC,IAAoCN,KAAKE,MAAAA,GAASK;AACxE,GAFqC;;;ACP9B,IAAMC,4CACT;;;AFUG,IAAMC,gCAAN,cAA4CC,wCAAAA;EAZnD,OAYmDA;;;EACjD,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAAS,MAAMC,sBAAAA;AACrB,UAAMC,UAAU,MAAM,IAAIC,sCAA8C;MACtEC,QAAQC;IACV,CAAA,EACGL,OAAOA,MAAAA,EACPM,MAAK;AACR,WAAO;MAACJ;;EACV;AACF;;;ADnBO,IAAMK,+BAA+B,iCAC1CC,wDACE;EAAEC,UAAU;IAAE,CAACC,4EAAAA,GAA+B;EAAE;EAAGC,QAAQC;AAAiB,GAC5E;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,8BAA8BC,OAAOF,MAAAA;EACrD,GAFS;AAGX,CAAA,GAPwC;","names":["import_blocknative_ethereum_gas_payload_plugin","url","Authorization","config","headers","getGasFromBlocknative","axios","get","data","EthereumGasBlocknativeWitnessConfigSchema","EthereumGasBlocknativeWitness","AbstractWitness","configSchemas","EthereumGasBlocknativeWitnessConfigSchema","defaultConfigSchema","observeHandler","fields","getGasFromBlocknative","payload","PayloadBuilder","schema","EthereumGasBlocknativeSchema","build","EthereumGasBlocknativePlugin","createPayloadSetWitnessPlugin","required","EthereumGasBlocknativeSchema","schema","PayloadSetSchema","witness","params","EthereumGasBlocknativeWitness","create"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasBlocknativePlugin as default, EthereumGasBlocknativePlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,8BAAgC;AAChC,qDAA4E;AAE5E,6BAA+B;;;ACH/B,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,4CACT;;;AFUG,IAAM,gCAAN,cAA4C,wCAAqD;AAAA,EACtG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,yCAAyC;AAAA,EACrH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,MAAM,IAAI,sCAA8C;AAAA,MACtE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,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;","names":["import_blocknative_ethereum_gas_payload_plugin"]}
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/Plugin.ts
5
2
  import { EthereumGasBlocknativeSchema as EthereumGasBlocknativeSchema2 } from "@xyo-network/blocknative-ethereum-gas-payload-plugin";
6
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
@@ -15,50 +12,36 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
15
12
  import { axios } from "@xylabs/axios";
16
13
  var url = "https://api.blocknative.com/gasprices/blockprices";
17
14
  var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
18
- var config = {
19
- headers: {
20
- Authorization
21
- }
22
- };
23
- var getGasFromBlocknative = /* @__PURE__ */ __name(async () => {
15
+ var config = { headers: { Authorization } };
16
+ var getGasFromBlocknative = async () => {
24
17
  return (await axios.get(url, config)).data;
25
- }, "getGasFromBlocknative");
18
+ };
26
19
 
27
20
  // src/Schema.ts
28
21
  var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
29
22
 
30
23
  // src/Witness.ts
31
24
  var EthereumGasBlocknativeWitness = class extends AbstractWitness {
32
- static {
33
- __name(this, "EthereumGasBlocknativeWitness");
34
- }
35
- static configSchemas = [
36
- ...super.configSchemas,
37
- EthereumGasBlocknativeWitnessConfigSchema
38
- ];
25
+ static configSchemas = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema];
39
26
  static defaultConfigSchema = EthereumGasBlocknativeWitnessConfigSchema;
40
27
  async observeHandler() {
41
28
  const fields = await getGasFromBlocknative();
42
29
  const payload = await new PayloadBuilder({
43
30
  schema: EthereumGasBlocknativeSchema
44
31
  }).fields(fields).build();
45
- return [
46
- payload
47
- ];
32
+ return [payload];
48
33
  }
49
34
  };
50
35
 
51
36
  // src/Plugin.ts
52
- var EthereumGasBlocknativePlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
53
- required: {
54
- [EthereumGasBlocknativeSchema2]: 1
55
- },
56
- schema: PayloadSetSchema
57
- }, {
58
- witness: /* @__PURE__ */ __name(async (params) => {
59
- return await EthereumGasBlocknativeWitness.create(params);
60
- }, "witness")
61
- }), "EthereumGasBlocknativePlugin");
37
+ var EthereumGasBlocknativePlugin = () => createPayloadSetWitnessPlugin(
38
+ { required: { [EthereumGasBlocknativeSchema2]: 1 }, schema: PayloadSetSchema },
39
+ {
40
+ witness: async (params) => {
41
+ return await EthereumGasBlocknativeWitness.create(params);
42
+ }
43
+ }
44
+ );
62
45
  export {
63
46
  EthereumGasBlocknativePlugin,
64
47
  EthereumGasBlocknativeWitness,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,SAASA,gCAAAA,qCAAoC;AAC7C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,uBAAuB;AAChC,SAAwCC,oCAAoC;AAE5E,SAASC,sBAAsB;;;ACH/B,SAASC,aAAa;AAGtB,IAAMC,MAAM;AAEZ,IAAMC,gBAAgB;AACtB,IAAMC,SAAS;EAAEC,SAAS;IAAEF;EAAc;AAAE;AAErC,IAAMG,wBAAwB,mCAAA;AACnC,UAAQ,MAAMC,MAAMC,IAAoCN,KAAKE,MAAAA,GAASK;AACxE,GAFqC;;;ACP9B,IAAMC,4CACT;;;AFUG,IAAMC,gCAAN,cAA4CC,gBAAAA;EAZnD,OAYmDA;;;EACjD,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAAS,MAAMC,sBAAAA;AACrB,UAAMC,UAAU,MAAM,IAAIC,eAA8C;MACtEC,QAAQC;IACV,CAAA,EACGL,OAAOA,MAAAA,EACPM,MAAK;AACR,WAAO;MAACJ;;EACV;AACF;;;ADnBO,IAAMK,+BAA+B,6BAC1CC,8BACE;EAAEC,UAAU;IAAE,CAACC,6BAAAA,GAA+B;EAAE;EAAGC,QAAQC;AAAiB,GAC5E;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,8BAA8BC,OAAOF,MAAAA;EACrD,GAFS;AAGX,CAAA,GAPwC;","names":["EthereumGasBlocknativeSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","AbstractWitness","EthereumGasBlocknativeSchema","PayloadBuilder","axios","url","Authorization","config","headers","getGasFromBlocknative","axios","get","data","EthereumGasBlocknativeWitnessConfigSchema","EthereumGasBlocknativeWitness","AbstractWitness","configSchemas","EthereumGasBlocknativeWitnessConfigSchema","defaultConfigSchema","observeHandler","fields","getGasFromBlocknative","payload","PayloadBuilder","schema","EthereumGasBlocknativeSchema","build","EthereumGasBlocknativePlugin","createPayloadSetWitnessPlugin","required","EthereumGasBlocknativeSchema","schema","PayloadSetSchema","witness","params","EthereumGasBlocknativeWitness","create"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,SAAS,gCAAAA,qCAAoC;AAC7C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAChC,SAAwC,oCAAoC;AAE5E,SAAS,sBAAsB;;;ACH/B,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,4CACT;;;AFUG,IAAM,gCAAN,cAA4C,gBAAqD;AAAA,EACtG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,yCAAyC;AAAA,EACrH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,MAAM,IAAI,eAA8C;AAAA,MACtE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,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;","names":["EthereumGasBlocknativeSchema","EthereumGasBlocknativeSchema"]}
@@ -3,7 +3,6 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
6
  var __export = (target, all) => {
8
7
  for (var name in all)
9
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -42,48 +41,34 @@ var import_payload_builder = require("@xyo-network/payload-builder");
42
41
  var import_axios = require("@xylabs/axios");
43
42
  var url = "https://api.blocknative.com/gasprices/blockprices";
44
43
  var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
45
- var config = {
46
- headers: {
47
- Authorization
48
- }
49
- };
50
- var getGasFromBlocknative = /* @__PURE__ */ __name(async () => {
44
+ var config = { headers: { Authorization } };
45
+ var getGasFromBlocknative = async () => {
51
46
  return (await import_axios.axios.get(url, config)).data;
52
- }, "getGasFromBlocknative");
47
+ };
53
48
 
54
49
  // src/Schema.ts
55
50
  var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
56
51
 
57
52
  // src/Witness.ts
58
53
  var EthereumGasBlocknativeWitness = class extends import_abstract_witness.AbstractWitness {
59
- static {
60
- __name(this, "EthereumGasBlocknativeWitness");
61
- }
62
- static configSchemas = [
63
- ...super.configSchemas,
64
- EthereumGasBlocknativeWitnessConfigSchema
65
- ];
54
+ static configSchemas = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema];
66
55
  static defaultConfigSchema = EthereumGasBlocknativeWitnessConfigSchema;
67
56
  async observeHandler() {
68
57
  const fields = await getGasFromBlocknative();
69
58
  const payload = await new import_payload_builder.PayloadBuilder({
70
59
  schema: import_blocknative_ethereum_gas_payload_plugin.EthereumGasBlocknativeSchema
71
60
  }).fields(fields).build();
72
- return [
73
- payload
74
- ];
61
+ return [payload];
75
62
  }
76
63
  };
77
64
 
78
65
  // src/Plugin.ts
79
- var EthereumGasBlocknativePlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
80
- required: {
81
- [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1
82
- },
83
- schema: import_payload_model.PayloadSetSchema
84
- }, {
85
- witness: /* @__PURE__ */ __name(async (params) => {
86
- return await EthereumGasBlocknativeWitness.create(params);
87
- }, "witness")
88
- }), "EthereumGasBlocknativePlugin");
66
+ var EthereumGasBlocknativePlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
67
+ { required: { [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
68
+ {
69
+ witness: async (params) => {
70
+ return await EthereumGasBlocknativeWitness.create(params);
71
+ }
72
+ }
73
+ );
89
74
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasBlocknativePlugin as default, EthereumGasBlocknativePlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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;;;;;;;;;;ACAA,IAAAA,kDAA6C;AAC7C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,qDAA4E;AAE5E,6BAA+B;;;ACH/B,mBAAsB;AAGtB,IAAMC,MAAM;AAEZ,IAAMC,gBAAgB;AACtB,IAAMC,SAAS;EAAEC,SAAS;IAAEF;EAAc;AAAE;AAErC,IAAMG,wBAAwB,mCAAA;AACnC,UAAQ,MAAMC,mBAAMC,IAAoCN,KAAKE,MAAAA,GAASK;AACxE,GAFqC;;;ACP9B,IAAMC,4CACT;;;AFUG,IAAMC,gCAAN,cAA4CC,wCAAAA;EAZnD,OAYmDA;;;EACjD,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAAS,MAAMC,sBAAAA;AACrB,UAAMC,UAAU,MAAM,IAAIC,sCAA8C;MACtEC,QAAQC;IACV,CAAA,EACGL,OAAOA,MAAAA,EACPM,MAAK;AACR,WAAO;MAACJ;;EACV;AACF;;;ADnBO,IAAMK,+BAA+B,iCAC1CC,wDACE;EAAEC,UAAU;IAAE,CAACC,4EAAAA,GAA+B;EAAE;EAAGC,QAAQC;AAAiB,GAC5E;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,8BAA8BC,OAAOF,MAAAA;EACrD,GAFS;AAGX,CAAA,GAPwC;","names":["import_blocknative_ethereum_gas_payload_plugin","url","Authorization","config","headers","getGasFromBlocknative","axios","get","data","EthereumGasBlocknativeWitnessConfigSchema","EthereumGasBlocknativeWitness","AbstractWitness","configSchemas","EthereumGasBlocknativeWitnessConfigSchema","defaultConfigSchema","observeHandler","fields","getGasFromBlocknative","payload","PayloadBuilder","schema","EthereumGasBlocknativeSchema","build","EthereumGasBlocknativePlugin","createPayloadSetWitnessPlugin","required","EthereumGasBlocknativeSchema","schema","PayloadSetSchema","witness","params","EthereumGasBlocknativeWitness","create"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasBlocknativePlugin as default, EthereumGasBlocknativePlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,8BAAgC;AAChC,qDAA4E;AAE5E,6BAA+B;;;ACH/B,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,4CACT;;;AFUG,IAAM,gCAAN,cAA4C,wCAAqD;AAAA,EACtG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,yCAAyC;AAAA,EACrH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,MAAM,IAAI,sCAA8C;AAAA,MACtE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,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;","names":["import_blocknative_ethereum_gas_payload_plugin"]}
@@ -1,6 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/Plugin.ts
5
2
  import { EthereumGasBlocknativeSchema as EthereumGasBlocknativeSchema2 } from "@xyo-network/blocknative-ethereum-gas-payload-plugin";
6
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
@@ -15,50 +12,36 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
15
12
  import { axios } from "@xylabs/axios";
16
13
  var url = "https://api.blocknative.com/gasprices/blockprices";
17
14
  var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
18
- var config = {
19
- headers: {
20
- Authorization
21
- }
22
- };
23
- var getGasFromBlocknative = /* @__PURE__ */ __name(async () => {
15
+ var config = { headers: { Authorization } };
16
+ var getGasFromBlocknative = async () => {
24
17
  return (await axios.get(url, config)).data;
25
- }, "getGasFromBlocknative");
18
+ };
26
19
 
27
20
  // src/Schema.ts
28
21
  var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
29
22
 
30
23
  // src/Witness.ts
31
24
  var EthereumGasBlocknativeWitness = class extends AbstractWitness {
32
- static {
33
- __name(this, "EthereumGasBlocknativeWitness");
34
- }
35
- static configSchemas = [
36
- ...super.configSchemas,
37
- EthereumGasBlocknativeWitnessConfigSchema
38
- ];
25
+ static configSchemas = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema];
39
26
  static defaultConfigSchema = EthereumGasBlocknativeWitnessConfigSchema;
40
27
  async observeHandler() {
41
28
  const fields = await getGasFromBlocknative();
42
29
  const payload = await new PayloadBuilder({
43
30
  schema: EthereumGasBlocknativeSchema
44
31
  }).fields(fields).build();
45
- return [
46
- payload
47
- ];
32
+ return [payload];
48
33
  }
49
34
  };
50
35
 
51
36
  // src/Plugin.ts
52
- var EthereumGasBlocknativePlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
53
- required: {
54
- [EthereumGasBlocknativeSchema2]: 1
55
- },
56
- schema: PayloadSetSchema
57
- }, {
58
- witness: /* @__PURE__ */ __name(async (params) => {
59
- return await EthereumGasBlocknativeWitness.create(params);
60
- }, "witness")
61
- }), "EthereumGasBlocknativePlugin");
37
+ var EthereumGasBlocknativePlugin = () => createPayloadSetWitnessPlugin(
38
+ { required: { [EthereumGasBlocknativeSchema2]: 1 }, schema: PayloadSetSchema },
39
+ {
40
+ witness: async (params) => {
41
+ return await EthereumGasBlocknativeWitness.create(params);
42
+ }
43
+ }
44
+ );
62
45
  export {
63
46
  EthereumGasBlocknativePlugin,
64
47
  EthereumGasBlocknativeWitness,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,SAASA,gCAAAA,qCAAoC;AAC7C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,uBAAuB;AAChC,SAAwCC,oCAAoC;AAE5E,SAASC,sBAAsB;;;ACH/B,SAASC,aAAa;AAGtB,IAAMC,MAAM;AAEZ,IAAMC,gBAAgB;AACtB,IAAMC,SAAS;EAAEC,SAAS;IAAEF;EAAc;AAAE;AAErC,IAAMG,wBAAwB,mCAAA;AACnC,UAAQ,MAAMC,MAAMC,IAAoCN,KAAKE,MAAAA,GAASK;AACxE,GAFqC;;;ACP9B,IAAMC,4CACT;;;AFUG,IAAMC,gCAAN,cAA4CC,gBAAAA;EAZnD,OAYmDA;;;EACjD,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EAEvD,MAAyBE,iBAAqC;AAC5D,UAAMC,SAAS,MAAMC,sBAAAA;AACrB,UAAMC,UAAU,MAAM,IAAIC,eAA8C;MACtEC,QAAQC;IACV,CAAA,EACGL,OAAOA,MAAAA,EACPM,MAAK;AACR,WAAO;MAACJ;;EACV;AACF;;;ADnBO,IAAMK,+BAA+B,6BAC1CC,8BACE;EAAEC,UAAU;IAAE,CAACC,6BAAAA,GAA+B;EAAE;EAAGC,QAAQC;AAAiB,GAC5E;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,8BAA8BC,OAAOF,MAAAA;EACrD,GAFS;AAGX,CAAA,GAPwC;","names":["EthereumGasBlocknativeSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","AbstractWitness","EthereumGasBlocknativeSchema","PayloadBuilder","axios","url","Authorization","config","headers","getGasFromBlocknative","axios","get","data","EthereumGasBlocknativeWitnessConfigSchema","EthereumGasBlocknativeWitness","AbstractWitness","configSchemas","EthereumGasBlocknativeWitnessConfigSchema","defaultConfigSchema","observeHandler","fields","getGasFromBlocknative","payload","PayloadBuilder","schema","EthereumGasBlocknativeSchema","build","EthereumGasBlocknativePlugin","createPayloadSetWitnessPlugin","required","EthereumGasBlocknativeSchema","schema","PayloadSetSchema","witness","params","EthereumGasBlocknativeWitness","create"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,SAAS,gCAAAA,qCAAoC;AAC7C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAChC,SAAwC,oCAAoC;AAE5E,SAAS,sBAAsB;;;ACH/B,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,4CACT;;;AFUG,IAAM,gCAAN,cAA4C,gBAAqD;AAAA,EACtG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,yCAAyC;AAAA,EACrH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,MAAM,IAAI,eAA8C;AAAA,MACtE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,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;","names":["EthereumGasBlocknativeSchema","EthereumGasBlocknativeSchema"]}
@@ -2,11 +2,7 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __reflectGet = Reflect.get;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
6
  var __export = (target, all) => {
11
7
  for (var name in all)
12
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -20,8 +16,6 @@ var __copyProps = (to, from, except, desc) => {
20
16
  return to;
21
17
  };
22
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
24
- var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
25
19
 
26
20
  // src/index.ts
27
21
  var src_exports = {};
@@ -47,49 +41,36 @@ var import_payload_builder = require("@xyo-network/payload-builder");
47
41
  var import_axios = require("@xylabs/axios");
48
42
  var url = "https://api.blocknative.com/gasprices/blockprices";
49
43
  var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
50
- var config = {
51
- headers: {
52
- Authorization
53
- }
54
- };
55
- var getGasFromBlocknative = /* @__PURE__ */ __name(async () => {
44
+ var config = { headers: { Authorization } };
45
+ var getGasFromBlocknative = async () => {
56
46
  return (await import_axios.axios.get(url, config)).data;
57
- }, "getGasFromBlocknative");
47
+ };
58
48
 
59
49
  // src/Schema.ts
60
50
  var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
61
51
 
62
52
  // src/Witness.ts
63
- var _EthereumGasBlocknativeWitness = class _EthereumGasBlocknativeWitness extends import_abstract_witness.AbstractWitness {
53
+ var EthereumGasBlocknativeWitness = class extends import_abstract_witness.AbstractWitness {
54
+ static configSchemas = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema];
55
+ static defaultConfigSchema = EthereumGasBlocknativeWitnessConfigSchema;
64
56
  async observeHandler() {
65
57
  const fields = await getGasFromBlocknative();
66
58
  const payload = await new import_payload_builder.PayloadBuilder({
67
59
  schema: import_blocknative_ethereum_gas_payload_plugin.EthereumGasBlocknativeSchema
68
60
  }).fields(fields).build();
69
- return [
70
- payload
71
- ];
61
+ return [payload];
72
62
  }
73
63
  };
74
- __name(_EthereumGasBlocknativeWitness, "EthereumGasBlocknativeWitness");
75
- __publicField(_EthereumGasBlocknativeWitness, "configSchemas", [
76
- ...__superGet(_EthereumGasBlocknativeWitness, _EthereumGasBlocknativeWitness, "configSchemas"),
77
- EthereumGasBlocknativeWitnessConfigSchema
78
- ]);
79
- __publicField(_EthereumGasBlocknativeWitness, "defaultConfigSchema", EthereumGasBlocknativeWitnessConfigSchema);
80
- var EthereumGasBlocknativeWitness = _EthereumGasBlocknativeWitness;
81
64
 
82
65
  // src/Plugin.ts
83
- var EthereumGasBlocknativePlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
84
- required: {
85
- [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1
86
- },
87
- schema: import_payload_model.PayloadSetSchema
88
- }, {
89
- witness: /* @__PURE__ */ __name(async (params) => {
90
- return await EthereumGasBlocknativeWitness.create(params);
91
- }, "witness")
92
- }), "EthereumGasBlocknativePlugin");
66
+ var EthereumGasBlocknativePlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
67
+ { required: { [import_blocknative_ethereum_gas_payload_plugin2.EthereumGasBlocknativeSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
68
+ {
69
+ witness: async (params) => {
70
+ return await EthereumGasBlocknativeWitness.create(params);
71
+ }
72
+ }
73
+ );
93
74
  // Annotate the CommonJS export names for ESM import in node:
94
75
  0 && (module.exports = {
95
76
  EthereumGasBlocknativePlugin,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasBlocknativePlugin as default, EthereumGasBlocknativePlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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;;;;;;;;;;ACAA,IAAAA,kDAA6C;AAC7C,2BAAiC;AACjC,+BAA8C;;;ACF9C,8BAAgC;AAChC,qDAA4E;AAE5E,6BAA+B;;;ACH/B,mBAAsB;AAGtB,IAAMC,MAAM;AAEZ,IAAMC,gBAAgB;AACtB,IAAMC,SAAS;EAAEC,SAAS;IAAEF;EAAc;AAAE;AAErC,IAAMG,wBAAwB,mCAAA;AACnC,UAAQ,MAAMC,mBAAMC,IAAoCN,KAAKE,MAAAA,GAASK;AACxE,GAFqC;;;ACP9B,IAAMC,4CACT;;;AFUG,IAAMC,iCAAN,MAAMA,uCAAsCC,wCAAAA;EAIjD,MAAyBC,iBAAqC;AAC5D,UAAMC,SAAS,MAAMC,sBAAAA;AACrB,UAAMC,UAAU,MAAM,IAAIC,sCAA8C;MACtEC,QAAQC;IACV,CAAA,EACGL,OAAOA,MAAAA,EACPM,MAAK;AACR,WAAO;MAACJ;;EACV;AACF;AAbmDJ;AACjD,cADWD,gCACcU,iBAA0B;KAAI,2EAAMA;EAAeC;;AAC5E,cAFWX,gCAEcY,uBAA8BD;AAFlD,IAAMX,gCAAN;;;ADNA,IAAMa,+BAA+B,iCAC1CC,wDACE;EAAEC,UAAU;IAAE,CAACC,4EAAAA,GAA+B;EAAE;EAAGC,QAAQC;AAAiB,GAC5E;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,8BAA8BC,OAAOF,MAAAA;EACrD,GAFS;AAGX,CAAA,GAPwC;","names":["import_blocknative_ethereum_gas_payload_plugin","url","Authorization","config","headers","getGasFromBlocknative","axios","get","data","EthereumGasBlocknativeWitnessConfigSchema","EthereumGasBlocknativeWitness","AbstractWitness","observeHandler","fields","getGasFromBlocknative","payload","PayloadBuilder","schema","EthereumGasBlocknativeSchema","build","configSchemas","EthereumGasBlocknativeWitnessConfigSchema","defaultConfigSchema","EthereumGasBlocknativePlugin","createPayloadSetWitnessPlugin","required","EthereumGasBlocknativeSchema","schema","PayloadSetSchema","witness","params","EthereumGasBlocknativeWitness","create"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Config.ts'\n// eslint-disable-next-line import/no-default-export\nexport { EthereumGasBlocknativePlugin as default, EthereumGasBlocknativePlugin } from './Plugin.ts'\nexport * from './Schema.ts'\nexport * from './Witness.ts'\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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,8BAAgC;AAChC,qDAA4E;AAE5E,6BAA+B;;;ACH/B,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,4CACT;;;AFUG,IAAM,gCAAN,cAA4C,wCAAqD;AAAA,EACtG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,yCAAyC;AAAA,EACrH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,MAAM,IAAI,sCAA8C;AAAA,MACtE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,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;","names":["import_blocknative_ethereum_gas_payload_plugin"]}
@@ -1,11 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getProtoOf = Object.getPrototypeOf;
3
- var __reflectGet = Reflect.get;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
8
-
9
1
  // src/Plugin.ts
10
2
  import { EthereumGasBlocknativeSchema as EthereumGasBlocknativeSchema2 } from "@xyo-network/blocknative-ethereum-gas-payload-plugin";
11
3
  import { PayloadSetSchema } from "@xyo-network/payload-model";
@@ -20,49 +12,36 @@ import { PayloadBuilder } from "@xyo-network/payload-builder";
20
12
  import { axios } from "@xylabs/axios";
21
13
  var url = "https://api.blocknative.com/gasprices/blockprices";
22
14
  var Authorization = "9d3e23c3-e31d-4f9c-9d7c-c579cb75d226";
23
- var config = {
24
- headers: {
25
- Authorization
26
- }
27
- };
28
- var getGasFromBlocknative = /* @__PURE__ */ __name(async () => {
15
+ var config = { headers: { Authorization } };
16
+ var getGasFromBlocknative = async () => {
29
17
  return (await axios.get(url, config)).data;
30
- }, "getGasFromBlocknative");
18
+ };
31
19
 
32
20
  // src/Schema.ts
33
21
  var EthereumGasBlocknativeWitnessConfigSchema = "network.xyo.blockchain.ethereum.gas.blocknative.witness.config";
34
22
 
35
23
  // src/Witness.ts
36
- var _EthereumGasBlocknativeWitness = class _EthereumGasBlocknativeWitness extends AbstractWitness {
24
+ var EthereumGasBlocknativeWitness = class extends AbstractWitness {
25
+ static configSchemas = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema];
26
+ static defaultConfigSchema = EthereumGasBlocknativeWitnessConfigSchema;
37
27
  async observeHandler() {
38
28
  const fields = await getGasFromBlocknative();
39
29
  const payload = await new PayloadBuilder({
40
30
  schema: EthereumGasBlocknativeSchema
41
31
  }).fields(fields).build();
42
- return [
43
- payload
44
- ];
32
+ return [payload];
45
33
  }
46
34
  };
47
- __name(_EthereumGasBlocknativeWitness, "EthereumGasBlocknativeWitness");
48
- __publicField(_EthereumGasBlocknativeWitness, "configSchemas", [
49
- ...__superGet(_EthereumGasBlocknativeWitness, _EthereumGasBlocknativeWitness, "configSchemas"),
50
- EthereumGasBlocknativeWitnessConfigSchema
51
- ]);
52
- __publicField(_EthereumGasBlocknativeWitness, "defaultConfigSchema", EthereumGasBlocknativeWitnessConfigSchema);
53
- var EthereumGasBlocknativeWitness = _EthereumGasBlocknativeWitness;
54
35
 
55
36
  // src/Plugin.ts
56
- var EthereumGasBlocknativePlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
57
- required: {
58
- [EthereumGasBlocknativeSchema2]: 1
59
- },
60
- schema: PayloadSetSchema
61
- }, {
62
- witness: /* @__PURE__ */ __name(async (params) => {
63
- return await EthereumGasBlocknativeWitness.create(params);
64
- }, "witness")
65
- }), "EthereumGasBlocknativePlugin");
37
+ var EthereumGasBlocknativePlugin = () => createPayloadSetWitnessPlugin(
38
+ { required: { [EthereumGasBlocknativeSchema2]: 1 }, schema: PayloadSetSchema },
39
+ {
40
+ witness: async (params) => {
41
+ return await EthereumGasBlocknativeWitness.create(params);
42
+ }
43
+ }
44
+ );
66
45
  export {
67
46
  EthereumGasBlocknativePlugin,
68
47
  EthereumGasBlocknativeWitness,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,SAASA,gCAAAA,qCAAoC;AAC7C,SAASC,wBAAwB;AACjC,SAASC,qCAAqC;;;ACF9C,SAASC,uBAAuB;AAChC,SAAwCC,oCAAoC;AAE5E,SAASC,sBAAsB;;;ACH/B,SAASC,aAAa;AAGtB,IAAMC,MAAM;AAEZ,IAAMC,gBAAgB;AACtB,IAAMC,SAAS;EAAEC,SAAS;IAAEF;EAAc;AAAE;AAErC,IAAMG,wBAAwB,mCAAA;AACnC,UAAQ,MAAMC,MAAMC,IAAoCN,KAAKE,MAAAA,GAASK;AACxE,GAFqC;;;ACP9B,IAAMC,4CACT;;;AFUG,IAAMC,iCAAN,MAAMA,uCAAsCC,gBAAAA;EAIjD,MAAyBC,iBAAqC;AAC5D,UAAMC,SAAS,MAAMC,sBAAAA;AACrB,UAAMC,UAAU,MAAM,IAAIC,eAA8C;MACtEC,QAAQC;IACV,CAAA,EACGL,OAAOA,MAAAA,EACPM,MAAK;AACR,WAAO;MAACJ;;EACV;AACF;AAbmDJ;AACjD,cADWD,gCACcU,iBAA0B;KAAI,2EAAMA;EAAeC;;AAC5E,cAFWX,gCAEcY,uBAA8BD;AAFlD,IAAMX,gCAAN;;;ADNA,IAAMa,+BAA+B,6BAC1CC,8BACE;EAAEC,UAAU;IAAE,CAACC,6BAAAA,GAA+B;EAAE;EAAGC,QAAQC;AAAiB,GAC5E;EACEC,SAAS,8BAAOC,WAAAA;AACd,WAAQ,MAAMC,8BAA8BC,OAAOF,MAAAA;EACrD,GAFS;AAGX,CAAA,GAPwC;","names":["EthereumGasBlocknativeSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","AbstractWitness","EthereumGasBlocknativeSchema","PayloadBuilder","axios","url","Authorization","config","headers","getGasFromBlocknative","axios","get","data","EthereumGasBlocknativeWitnessConfigSchema","EthereumGasBlocknativeWitness","AbstractWitness","observeHandler","fields","getGasFromBlocknative","payload","PayloadBuilder","schema","EthereumGasBlocknativeSchema","build","configSchemas","EthereumGasBlocknativeWitnessConfigSchema","defaultConfigSchema","EthereumGasBlocknativePlugin","createPayloadSetWitnessPlugin","required","EthereumGasBlocknativeSchema","schema","PayloadSetSchema","witness","params","EthereumGasBlocknativeWitness","create"]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getGasFromBlocknative.ts","../../src/Schema.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.ts'\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 { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { EthereumGasBlocknativePayload, EthereumGasBlocknativeSchema } from '@xyo-network/blocknative-ethereum-gas-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema } from '@xyo-network/payload-model'\nimport { TimestampWitnessParams } from '@xyo-network/witness-timestamp'\n\nimport { EthereumGasBlocknativeWitnessConfig } from './Config.ts'\nimport { getGasFromBlocknative } from './lib/index.ts'\nimport { EthereumGasBlocknativeWitnessConfigSchema } from './Schema.ts'\n\nexport type EthereumGasBlocknativeWitnessParams = TimestampWitnessParams<AnyConfigSchema<EthereumGasBlocknativeWitnessConfig>>\nexport class EthereumGasBlocknativeWitness extends AbstractWitness<EthereumGasBlocknativeWitnessParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EthereumGasBlocknativeWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = EthereumGasBlocknativeWitnessConfigSchema\n\n protected override async observeHandler(): Promise<Payload[]> {\n const fields = await getGasFromBlocknative()\n const payload = await new PayloadBuilder<EthereumGasBlocknativePayload>({\n schema: EthereumGasBlocknativeSchema,\n })\n .fields(fields)\n .build()\n return [payload]\n }\n}\n","import { axios } from '@xylabs/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,SAAS,gCAAAA,qCAAoC;AAC7C,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACF9C,SAAS,uBAAuB;AAChC,SAAwC,oCAAoC;AAE5E,SAAS,sBAAsB;;;ACH/B,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,4CACT;;;AFUG,IAAM,gCAAN,cAA4C,gBAAqD;AAAA,EACtG,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,yCAAyC;AAAA,EACrH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,iBAAqC;AAC5D,UAAM,SAAS,MAAM,sBAAsB;AAC3C,UAAM,UAAU,MAAM,IAAI,eAA8C;AAAA,MACtE,QAAQ;AAAA,IACV,CAAC,EACE,OAAO,MAAM,EACb,MAAM;AACT,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;;;ADnBO,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;","names":["EthereumGasBlocknativeSchema","EthereumGasBlocknativeSchema"]}
package/package.json CHANGED
@@ -10,19 +10,19 @@
10
10
  "url": "https://github.com/XYOracleNetwork/plugins/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/axios": "^3.6.8",
14
- "@xyo-network/abstract-witness": "^2.111.2",
15
- "@xyo-network/blocknative-ethereum-gas-payload-plugin": "^2.99.5",
16
- "@xyo-network/module-model": "^2.111.2",
17
- "@xyo-network/payload-builder": "^2.111.2",
18
- "@xyo-network/payload-model": "^2.111.2",
19
- "@xyo-network/payloadset-plugin": "^2.111.2",
20
- "@xyo-network/witness-timestamp": "^2.111.2"
13
+ "@xylabs/axios": "^3.6.12",
14
+ "@xyo-network/abstract-witness": "^2.111.3",
15
+ "@xyo-network/blocknative-ethereum-gas-payload-plugin": "^2.99.6",
16
+ "@xyo-network/module-model": "^2.111.3",
17
+ "@xyo-network/payload-builder": "^2.111.3",
18
+ "@xyo-network/payload-model": "^2.111.3",
19
+ "@xyo-network/payloadset-plugin": "^2.111.3",
20
+ "@xyo-network/witness-timestamp": "^2.111.3"
21
21
  },
22
22
  "devDependencies": {
23
- "@xylabs/ts-scripts-yarn3": "^3.15.13",
24
- "@xylabs/tsconfig": "^3.15.13",
25
- "@xyo-network/payload-wrapper": "^2.111.2",
23
+ "@xylabs/ts-scripts-yarn3": "^3.15.14",
24
+ "@xylabs/tsconfig": "^3.15.14",
25
+ "@xyo-network/payload-wrapper": "^2.111.3",
26
26
  "typescript": "^5.5.4"
27
27
  },
28
28
  "description": "Typescript/Javascript Plugins for XYO Platform",
@@ -64,6 +64,6 @@
64
64
  "url": "https://github.com/XYOracleNetwork/plugins.git"
65
65
  },
66
66
  "sideEffects": false,
67
- "version": "2.99.5",
67
+ "version": "2.99.6",
68
68
  "type": "module"
69
69
  }