@xyo-network/uniswap-v3-crypto-market-plugin 4.1.1 → 4.2.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.
@@ -1,86 +1,5 @@
1
- import { UniswapCryptoMarketWitnessConfigSchema, UniswapCryptoPair } from '@xyo-network/uniswap-crypto-market-payload-plugin';
2
- import { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
3
- import { Provider } from 'ethers';
4
- import { Token } from '@uniswap/sdk-core';
5
- import { Pool } from '@uniswap/v3-sdk';
6
- import { Enum, EnumValue } from '@xylabs/enum';
7
- import { IERC20Metadata } from '@xyo-network/open-zeppelin-typechain';
8
- import { IUniswapV3Pool } from '@xyo-network/uniswap-typechain';
9
- import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
10
- import { AbstractWitness } from '@xyo-network/abstract-witness';
11
- import { AnyConfigSchema } from '@xyo-network/module-model';
12
- import { Schema, Payload } from '@xyo-network/payload-model';
13
-
14
- type UniswapCryptoMarketWitnessConfig = WitnessConfig<{
15
- pools?: string[];
16
- schema: UniswapCryptoMarketWitnessConfigSchema;
17
- }>;
18
-
19
- type EthersUniswapV3Slot0Fields = [bigint, bigint, bigint, bigint, bigint, bigint, boolean];
20
- type UniswapV3Slot0Fields = [bigint, number, number, number, number, number, boolean];
21
-
22
- declare class EthersUniswap3PoolSlot0Wrapper {
23
- protected values: EthersUniswapV3Slot0Fields;
24
- constructor(values: EthersUniswapV3Slot0Fields);
25
- get feeProtocol(): bigint;
26
- get observationCardinality(): bigint;
27
- get observationCardinalityNext(): bigint;
28
- get observationIndex(): bigint;
29
- get sqrtPriceX96(): bigint;
30
- get tick(): bigint;
31
- get unlocked(): boolean;
32
- }
33
-
34
- declare const ChainId: Enum<{
35
- MAINNET: 1;
36
- ROPSTEN: 3;
37
- RINKEBY: 4;
38
- GÖRLI: 5;
39
- KOVAN: 42;
40
- }>;
41
- type ChainId = EnumValue<typeof ChainId>;
42
- declare class EthersUniSwap3Pair {
43
- protected address: string;
44
- protected provider: Provider;
45
- private _pool?;
46
- private _poolContract?;
47
- private _slot0?;
48
- private _tokenContracts;
49
- private _tokens;
50
- constructor(address: string, provider: Provider);
51
- pool(): Promise<Pool>;
52
- poolContract(): IUniswapV3Pool;
53
- price(): Promise<{
54
- tokens: {
55
- address: string;
56
- symbol: string;
57
- value: number;
58
- }[];
59
- }>;
60
- slot0(): Promise<EthersUniswap3PoolSlot0Wrapper>;
61
- token(index: 0 | 1): Promise<Token>;
62
- tokenContract(index: 0 | 1): Promise<IERC20Metadata>;
63
- }
64
-
65
- declare const createUniswapPoolContracts: (provider: Provider, contracts: string[]) => EthersUniSwap3Pair[];
66
-
67
- declare const pricesFromUniswap3: (pools: EthersUniSwap3Pair[]) => Promise<UniswapCryptoPair[]>;
68
-
69
- declare const UniswapPoolContracts: string[];
70
-
71
- interface UniswapCryptoMarketWitnessParams extends WitnessParams<AnyConfigSchema<UniswapCryptoMarketWitnessConfig>> {
72
- provider?: Provider;
73
- }
74
- declare class UniswapCryptoMarketWitness<TParams extends UniswapCryptoMarketWitnessParams = UniswapCryptoMarketWitnessParams> extends AbstractWitness<TParams> {
75
- static readonly configSchemas: Schema[];
76
- static readonly defaultConfigSchema: Schema;
77
- protected pairs?: EthersUniSwap3Pair[];
78
- protected get provider(): Provider | undefined;
79
- protected observeHandler(): Promise<Payload[]>;
80
- protected startHandler(): Promise<void>;
81
- }
82
-
83
- declare const UniswapCryptoMarketPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<UniswapCryptoMarketWitness<UniswapCryptoMarketWitnessParams>>;
84
-
85
- export { ChainId, EthersUniSwap3Pair, EthersUniswap3PoolSlot0Wrapper, UniswapCryptoMarketPlugin, UniswapCryptoMarketWitness, UniswapPoolContracts, createUniswapPoolContracts, UniswapCryptoMarketPlugin as default, pricesFromUniswap3 };
86
- export type { EthersUniswapV3Slot0Fields, UniswapCryptoMarketWitnessConfig, UniswapCryptoMarketWitnessParams, UniswapV3Slot0Fields };
1
+ export * from './Config.ts';
2
+ export * from './lib/index.ts';
3
+ export { UniswapCryptoMarketPlugin as default, UniswapCryptoMarketPlugin } from './Plugin.ts';
4
+ export * from './Witness.ts';
5
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/uniswap-v3-crypto-market-plugin",
3
- "version": "4.1.1",
3
+ "version": "4.2.0",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -31,29 +31,28 @@
31
31
  "dependencies": {
32
32
  "@uniswap/sdk-core": "^7.7.2",
33
33
  "@uniswap/v3-sdk": "^3.25.2",
34
- "@xylabs/assert": "^4.13.23",
35
- "@xylabs/delay": "^4.13.23",
36
- "@xylabs/enum": "^4.13.23",
37
- "@xylabs/promise": "^4.13.23",
38
- "@xyo-network/abstract-witness": "^4.1.7",
39
- "@xyo-network/module-model": "^4.1.7",
34
+ "@xylabs/assert": "^4.15.1",
35
+ "@xylabs/delay": "^4.15.1",
36
+ "@xylabs/enum": "^4.15.1",
37
+ "@xylabs/promise": "^4.15.1",
38
+ "@xyo-network/abstract-witness": "^4.3.0",
39
+ "@xyo-network/module-model": "^4.3.0",
40
40
  "@xyo-network/open-zeppelin-typechain": "^3.5.4",
41
- "@xyo-network/payload-model": "^4.1.7",
42
- "@xyo-network/payloadset-plugin": "^4.1.7",
43
- "@xyo-network/uniswap-crypto-market-payload-plugin": "^4.1.1",
41
+ "@xyo-network/payload-model": "^4.3.0",
42
+ "@xyo-network/payloadset-plugin": "^4.3.0",
43
+ "@xyo-network/uniswap-crypto-market-payload-plugin": "^4.2.0",
44
44
  "@xyo-network/uniswap-typechain": "^3.5.4",
45
- "@xyo-network/witness-model": "^4.1.7",
45
+ "@xyo-network/witness-model": "^4.3.0",
46
46
  "ethers": "^6.15.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@ethersproject/address": "^5.8.0",
50
50
  "@ethersproject/bignumber": "^5.8.0",
51
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.24",
52
- "@xylabs/tsconfig": "^7.0.0-rc.24",
53
- "@xylabs/vitest-extended": "^4.13.23",
54
- "@xyo-network/payload-wrapper": "^4.1.7",
55
- "@xyo-network/witness-blockchain-abstract": "^4.1.7",
56
- "knip": "^5.62.0",
51
+ "@xylabs/ts-scripts-yarn3": "^7.0.1",
52
+ "@xylabs/tsconfig": "^7.0.1",
53
+ "@xylabs/vitest-extended": "^4.15.1",
54
+ "@xyo-network/payload-wrapper": "^4.3.0",
55
+ "@xyo-network/witness-blockchain-abstract": "^4.3.0",
57
56
  "typescript": "^5.8.3",
58
57
  "vitest": "^3.2.4"
59
58
  },