@xyo-network/ethers-ethereum-gas-plugin 2.51.9 → 2.51.10

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.
@@ -1,11 +1,10 @@
1
1
  import { XyoEthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin';
2
2
  import { PayloadSetSchema } from '@xyo-network/payload-model';
3
- import { createPayloadSetPlugin } from '@xyo-network/payloadset-plugin';
3
+ import { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin';
4
4
  import { XyoEthereumGasEthersWitness } from './Witness';
5
- export const XyoEthereumGasEthersPlugin = () => createPayloadSetPlugin({ required: { [XyoEthereumGasEthersSchema]: 1 }, schema: PayloadSetSchema }, {
5
+ export const XyoEthereumGasEthersPlugin = () => createPayloadSetWitnessPlugin({ required: { [XyoEthereumGasEthersSchema]: 1 }, schema: PayloadSetSchema }, {
6
6
  witness: async (params) => {
7
- const result = await XyoEthereumGasEthersWitness.create(params);
8
- return result;
7
+ return await XyoEthereumGasEthersWitness.create(params);
9
8
  },
10
9
  });
11
10
  //# sourceMappingURL=Plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAA2B,MAAM,gCAAgC,CAAA;AAEhG,OAAO,EAAE,2BAA2B,EAAqC,MAAM,WAAW,CAAA;AAE1F,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE,CAC7C,sBAAsB,CACpB,EAAE,QAAQ,EAAE,EAAE,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAC3E;IACE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC/D,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CACF,CAAA"}
1
+ {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAA;AAE9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAA;AAEvD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE,CAC7C,6BAA6B,CAC3B,EAAE,QAAQ,EAAE,EAAE,CAAC,0BAA0B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAC3E;IACE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,OAAO,MAAM,2BAA2B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACzD,CAAC;CACF,CACF,CAAA"}
@@ -6,13 +6,10 @@ import { getGasFromEthers } from './lib';
6
6
  import { XyoEthereumGasEthersWitnessConfigSchema } from './Schema';
7
7
  export class XyoEthereumGasEthersWitness extends TimestampWitness {
8
8
  static configSchema = XyoEthereumGasEthersWitnessConfigSchema;
9
- provider;
10
- constructor(params) {
11
- super(params);
12
- this.provider = params?.provider;
13
- }
14
- static async create(params) {
15
- return (await super.create(params));
9
+ _provider;
10
+ get provider() {
11
+ this._provider = this._provider ?? this.params?.provider;
12
+ return this._provider;
16
13
  }
17
14
  async observe() {
18
15
  const payload = new XyoPayloadBuilder({ schema: XyoEthereumGasEthersSchema })
@@ -1 +1 @@
1
- {"version":3,"file":"Witness.js","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,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AAM,sBAAsB,CAAA;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAA;AAUlE,MAAM,OAAO,2BAEX,SAAQ,gBAAyB;IACjC,MAAM,CAAU,YAAY,GAAG,uCAAuC,CAAA;IAE9D,SAAS,CAAW;IAE5B,IAAc,QAAQ;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAA;QACxD,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAEQ,KAAK,CAAC,OAAO;QACpB,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAA8B,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC;aACvG,MAAM,CAAC,MAAM,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC;aAC5E,KAAK,EAAE,CAAA;QACV,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IACjC,CAAC"}
@@ -1,4 +1,3 @@
1
- import { PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin';
2
- import { XyoEthereumGasEthersWitness, XyoEthereumGasEthersWitnessParams } from './Witness';
3
- export declare const XyoEthereumGasEthersPlugin: () => PayloadSetWitnessPlugin<XyoEthereumGasEthersWitness, XyoEthereumGasEthersWitnessParams>;
1
+ import { XyoEthereumGasEthersWitness } from './Witness';
2
+ export declare const XyoEthereumGasEthersPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<XyoEthereumGasEthersWitness<import("./Witness").XyoEthereumGasEthersWitnessParams>>;
4
3
  //# sourceMappingURL=Plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAEhG,OAAO,EAAE,2BAA2B,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAA;AAE1F,eAAO,MAAM,0BAA0B,+FASpC,CAAA"}
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAA;AAEvD,eAAO,MAAM,0BAA0B,4JAQpC,CAAA"}
@@ -1,16 +1,15 @@
1
1
  import { Provider } from '@ethersproject/providers';
2
- import { ModuleParams } from '@xyo-network/module';
2
+ import { AnyConfigSchema, ModuleParams } from '@xyo-network/module';
3
3
  import { XyoPayload } from '@xyo-network/payload-model';
4
- import { TimestampWitness, WitnessParams } from '@xyo-network/witness';
4
+ import { TimestampWitness } from '@xyo-network/witness';
5
5
  import { XyoEthereumGasEthersWitnessConfig } from './Config';
6
- export type XyoEthereumGasEthersWitnessParams = ModuleParams<XyoEthereumGasEthersWitnessConfig, {
7
- provider: Provider;
6
+ export type XyoEthereumGasEthersWitnessParams = ModuleParams<AnyConfigSchema<XyoEthereumGasEthersWitnessConfig>, undefined, {
7
+ provider?: Provider;
8
8
  }>;
9
- export declare class XyoEthereumGasEthersWitness extends TimestampWitness<WitnessParams<XyoEthereumGasEthersWitnessConfig>> {
9
+ export declare class XyoEthereumGasEthersWitness<TParams extends XyoEthereumGasEthersWitnessParams = XyoEthereumGasEthersWitnessParams> extends TimestampWitness<TParams> {
10
10
  static configSchema: "network.xyo.blockchain.ethereum.gas.ethers.witness.config";
11
- protected provider?: Provider;
12
- protected constructor(params: XyoEthereumGasEthersWitnessParams);
13
- static create(params?: XyoEthereumGasEthersWitnessParams): Promise<XyoEthereumGasEthersWitness>;
11
+ private _provider?;
12
+ protected get provider(): Provider | undefined;
14
13
  observe(): Promise<XyoPayload[]>;
15
14
  }
16
15
  //# sourceMappingURL=Witness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"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A;CACpB,CACF,CAAA;AAED,qBAAa,2BAA2B,CACtC,OAAO,SAAS,iCAAiC,GAAG,iCAAiC,CACrF,SAAQ,gBAAgB,CAAC,OAAO,CAAC;IACjC,OAAgB,YAAY,8DAA0C;IAEtE,OAAO,CAAC,SAAS,CAAC,CAAU;IAE5B,SAAS,KAAK,QAAQ,yBAGrB;IAEc,OAAO,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAMhD"}
package/package.json CHANGED
@@ -12,12 +12,12 @@
12
12
  "dependencies": {
13
13
  "@ethersproject/providers": "^5.7.2",
14
14
  "@xylabs/assert": "^2.7.4",
15
- "@xyo-network/ethers-ethereum-gas-payload-plugin": "^2.51.9",
16
- "@xyo-network/module": "^2.51.9",
17
- "@xyo-network/payload-builder": "^2.51.9",
18
- "@xyo-network/payload-model": "^2.51.9",
19
- "@xyo-network/payloadset-plugin": "^2.51.9",
20
- "@xyo-network/witness": "^2.51.9"
15
+ "@xyo-network/ethers-ethereum-gas-payload-plugin": "^2.51.10",
16
+ "@xyo-network/module": "^2.51.10",
17
+ "@xyo-network/payload-builder": "^2.51.10",
18
+ "@xyo-network/payload-model": "^2.51.10",
19
+ "@xyo-network/payloadset-plugin": "^2.51.10",
20
+ "@xyo-network/witness": "^2.51.10"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@xylabs/ts-scripts-yarn3": "^2.16.1",
@@ -57,5 +57,5 @@
57
57
  },
58
58
  "sideEffects": false,
59
59
  "types": "dist/types/index.d.ts",
60
- "version": "2.51.9"
60
+ "version": "2.51.10"
61
61
  }
package/src/Plugin.ts CHANGED
@@ -1,16 +1,15 @@
1
1
  import { XyoEthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'
2
2
  import { PayloadSetSchema } from '@xyo-network/payload-model'
3
- import { createPayloadSetPlugin, PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'
3
+ import { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'
4
4
 
5
- import { XyoEthereumGasEthersWitness, XyoEthereumGasEthersWitnessParams } from './Witness'
5
+ import { XyoEthereumGasEthersWitness } from './Witness'
6
6
 
7
7
  export const XyoEthereumGasEthersPlugin = () =>
8
- createPayloadSetPlugin<PayloadSetWitnessPlugin<XyoEthereumGasEthersWitness, XyoEthereumGasEthersWitnessParams>>(
8
+ createPayloadSetWitnessPlugin<XyoEthereumGasEthersWitness>(
9
9
  { required: { [XyoEthereumGasEthersSchema]: 1 }, schema: PayloadSetSchema },
10
10
  {
11
11
  witness: async (params) => {
12
- const result = await XyoEthereumGasEthersWitness.create(params)
13
- return result
12
+ return await XyoEthereumGasEthersWitness.create(params)
14
13
  },
15
14
  },
16
15
  )
package/src/Witness.ts CHANGED
@@ -1,34 +1,33 @@
1
1
  import { Provider } from '@ethersproject/providers'
2
2
  import { assertEx } from '@xylabs/assert'
3
3
  import { XyoEthereumGasEthersPayload, XyoEthereumGasEthersSchema } from '@xyo-network/ethers-ethereum-gas-payload-plugin'
4
- import { ModuleParams } from '@xyo-network/module'
4
+ import { AnyConfigSchema, ModuleParams } from '@xyo-network/module'
5
5
  import { XyoPayloadBuilder } from '@xyo-network/payload-builder'
6
6
  import { XyoPayload } from '@xyo-network/payload-model'
7
- import { TimestampWitness, WitnessParams } from '@xyo-network/witness'
7
+ import { TimestampWitness } from '@xyo-network/witness'
8
8
 
9
9
  import { XyoEthereumGasEthersWitnessConfig } from './Config'
10
10
  import { getGasFromEthers } from './lib'
11
11
  import { XyoEthereumGasEthersWitnessConfigSchema } from './Schema'
12
12
 
13
13
  export type XyoEthereumGasEthersWitnessParams = ModuleParams<
14
- XyoEthereumGasEthersWitnessConfig,
14
+ AnyConfigSchema<XyoEthereumGasEthersWitnessConfig>,
15
+ undefined,
15
16
  {
16
- provider: Provider
17
+ provider?: Provider
17
18
  }
18
19
  >
19
20
 
20
- export class XyoEthereumGasEthersWitness extends TimestampWitness<WitnessParams<XyoEthereumGasEthersWitnessConfig>> {
21
+ export class XyoEthereumGasEthersWitness<
22
+ TParams extends XyoEthereumGasEthersWitnessParams = XyoEthereumGasEthersWitnessParams,
23
+ > extends TimestampWitness<TParams> {
21
24
  static override configSchema = XyoEthereumGasEthersWitnessConfigSchema
22
25
 
23
- protected provider?: Provider
26
+ private _provider?: Provider
24
27
 
25
- protected constructor(params: XyoEthereumGasEthersWitnessParams) {
26
- super(params)
27
- this.provider = params?.provider
28
- }
29
-
30
- static override async create(params?: XyoEthereumGasEthersWitnessParams): Promise<XyoEthereumGasEthersWitness> {
31
- return (await super.create(params)) as XyoEthereumGasEthersWitness
28
+ protected get provider() {
29
+ this._provider = this._provider ?? this.params?.provider
30
+ return this._provider
32
31
  }
33
32
 
34
33
  override async observe(): Promise<XyoPayload[]> {